case MEDIC: { TogglePlayerControllable(playerid, 1); ResetPlayerWeapons(playerid); GivePlayerWeapon(playerid, 33, 200); GivePlayerWeapon(playerid, 22, 200); GivePlayerWeapon(playerid, 25, 200); GivePlayerWeapon(playerid, 11, 2); }
case MEDIC: { if(GetPlayerScore(playerid) >= 500){ TogglePlayerControllable(playerid, 1); ResetPlayerWeapons(playerid); GivePlayerWeapon(playerid, 33, 200); GivePlayerWeapon(playerid, 22, 200); GivePlayerWeapon(playerid, 25, 200); GivePlayerWeapon(playerid, 11, 2); } }
Код:
case MEDIC: { if(GetPlayerScore(playerid) >= 500){ TogglePlayerControllable(playerid, 1); ResetPlayerWeapons(playerid); GivePlayerWeapon(playerid, 33, 200); GivePlayerWeapon(playerid, 22, 200); GivePlayerWeapon(playerid, 25, 200); GivePlayerWeapon(playerid, 11, 2); } } |
Check if the player's score is less than 500 when selecting "Medic" team and return an error to inform them. OnPlayerSpawn callback has nothing to do with it by the way.
|
case MEDIC:
{
if(GetPlayerScore(playerid) < 500) return SendClientMessage(playerid, -1, "You need 500 score");
TogglePlayerControllable(playerid, 1);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 33, 200);
GivePlayerWeapon(playerid, 22, 200);
GivePlayerWeapon(playerid, 25, 200);
GivePlayerWeapon(playerid, 11, 2);
}
You need to put this in OnPlayerRequestSpawn.
Little fix: PHP код:
|
You need to put this in OnPlayerRequestSpawn.
Little fix: PHP код:
|
case MEDIC:
{
if(GetPlayerScore(playerid) < 500)
{
SendClientMessage(playerid, -1, "You need 500 score to select this class");
return 0;
}
TogglePlayerControllable(playerid, 1);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 33, 200);
GivePlayerWeapon(playerid, 22, 200);
GivePlayerWeapon(playerid, 25, 200);
GivePlayerWeapon(playerid, 11, 2);
}