I'm back again with more coding troubles
This time, it's code from the VDC I can't work, however.
The code randomises models on spawn.
Here is the provided code:
- Code: Select all
static const char* modelnames[] = {
"Model1", //0
"Model2", //1
"Model3", //2};
Here is the code edited to fit my needs:
- Code: Select all
static const char* modelnames[] = {
"models/hacks/watermelon.mdl", //0
"models/manhack.mdl", //1
};
I also add
- Code: Select all
PrecacheModel("models/manhack.mdl");
PrecacheModel("models/hacks/watermelon.mdl");
And replace
- Code: Select all
SetModel("models/manhack.mdl);
With
- Code: Select all
SetModel (modelnames[ random->RandomInt( 0, ARRAYSIZE(modelnames) - 1 ) ]);
Then compile.
I get this error, however:
npc_manhack.cpp(2377) : error C2065: 'modelnames' : undeclared identifier
Any ideas?
Help would be appreciated!