SA-MP Forums Archive
Whats Missing? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Whats Missing? (/showthread.php?tid=244627)



Whats Missing? - kickflipdude - 27.03.2011

Ok, so im trying to add classes, and this is what i have:


public OnPlayerRequestClass(playerid, classid)
{
// With this you save the chosen class number into pClass[playerid]
pClass[playerid] = classid;
return 1;
}



But, when i try to compile, it gives a error for pClass[playerid] = classid;


Can someone tell me whats wrong?


Re: Whats Missing? - airsoft - 27.03.2011

put
pawn Код:
new pClass[MAX_PLAYERS];
at the top


Re: Whats Missing? - kickflipdude - 27.03.2011

that is there, but it still says..


Re: Whats Missing? - kickflipdude - 27.03.2011

If anyones wondering, this is the error it shows:

: error 017: undefined symbol "pClass"
: warning 215: expression has no effect
: error 001: expected token: ";", but found "]"
: error 029: invalid expression, assumed zero
: fatal error 107: too many error messages on one line


Re: Whats Missing? - kickflipdude - 28.03.2011

Bump,

Anyone please?!?!?


Re: Whats Missing? - airsoft - 28.03.2011

Thats strange... it works for me :l

All i put was
pawn Код:
//Top of Script
new pClass[MAX_PLAYERS];
and
pawn Код:
//RequestClass
public OnPlayerRequestClass(playerid, classid)
{
    pClass[playerid] = classid;
    //I had other stuff here lol
    return 1;
}
I D K what you did wrong if that doesn't work :l


Re: Whats Missing? - Baboon - 28.03.2011

Hmm, try using SetPVarInt(playerid,"pClass",classid);
and get it using GetPVarInt(playerid,"pClass");

Hope I helped u out!