13.12.2011, 01:07
For each " AddPlayerClass ", you need a switch and case statement:
You have 10 lines of AddPlayerClass, so you need 10 case statements (0 counts as 1)
So all together, it should be like:
Inside of the case statements, you can add ApplyAnim, GameTextForPlayer, SendClientMessage, etc ...
If you want none of those for when you choose a different skin, you could do this method, which is more efficient and takes up less space:
pawn Код:
// under onplayerrequestclass
switch(classid)
{
case 0:
{
// this is addplayerclass # 1
}
case 1:
{
// this is addplayerclass # 2
}
case 2:
{
// etc ...
}
}
So all together, it should be like:
pawn Код:
switch(classid)
{
case 0:
{
// this is addplayerclass # 1
}
case 1:
{
// this is addplayerclass # 2
}
case 2:
{
// this is addplayerclass # 3
}
case 3:
{
// this is addplayerclass # 4
}
case 4:
{
// this is addplayerclass # 5
}
case 5:
{
// this is addplayerclass # 6
}
case 6:
{
// this is addplayerclass # 7
}
case 7:
{
// this is addplayerclass # 8
}
case 8:
{
// this is addplayerclass # 9
}
case 9:
{
// this is addplayerclass # 10
}
}
If you want none of those for when you choose a different skin, you could do this method, which is more efficient and takes up less space:
pawn Код:
switch(classid)
{
case 0..9: // addplayerclass from 0 to 9
{
return 1;
}
}