Posts: 106
Threads: 30
Joined: Jun 2013
Hello,
I have this script
((Under OnPlayerSpawn))
Код HTML:
case MEDIC:
{
TogglePlayerControllable(playerid, 1);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 33, 200);
GivePlayerWeapon(playerid, 22, 200);
GivePlayerWeapon(playerid, 25, 200);
GivePlayerWeapon(playerid, 11, 2);
}
Now I want to make it so, that if a player is score 500 he could join this,
But I don't know how, please help.
Posts: 106
Threads: 30
Joined: Jun 2013
Quote:
Originally Posted by FplayerGR
Код:
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);
}
}
this?
|
isn't working,
Posts: 11,827
Threads: 33
Joined: Dec 2011
Reputation:
0
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.
Posts: 106
Threads: 30
Joined: Jun 2013
Quote:
Originally Posted by Konstantinos
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.
|
sry but im not good at scripting, can you may edit it so,that it is for score 500?
Posts: 106
Threads: 30
Joined: Jun 2013
Quote:
Originally Posted by J4Rr3x
You need to put this in OnPlayerRequestSpawn.
Little fix:
PHP код:
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);
}
|
But this is not a Team, just a class. should I leave it there, where it was?
Posts: 106
Threads: 30
Joined: Jun 2013
Quote:
Originally Posted by J4Rr3x
You need to put this in OnPlayerRequestSpawn.
Little fix:
PHP код:
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);
}
|
Not workin,