24.02.2015, 15:38
pawn Code:
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
if(clickedid == Soldier)
{
{
if(GetPlayerScore(playerid) >= 0)//if player have 0 score then he can choose this class
{
SendClientMessage(playerid, COLOR_GREEN, "You chose the Soldier as your class.");
TextDrawShowForPlayer(playerid,SoldierBox);
TextDrawShowForPlayer(playerid,SoldierInfo);
TextDrawShowForPlayer(playerid,Spawn);
gPlayerClass[playerid] = SOLDIER;//setting the class to soldier
PickedClass[playerid] = 1;
SetPlayerVirtualWorld(playerid, 0);
SetPlayerArmour(playerid,99);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 31, 200);
GivePlayerWeapon(playerid, 25, 100)
GivePlayerWeapon(playerid, 24, 70);
TextDrawHideForPlayer(playerid,Box);
TextDrawHideForPlayer(playerid,Soldier);
TextDrawHideForPlayer(playerid,Class);
TextDrawHideForPlayer(playerid,JetTrooper);
}
}
}
else if(clickedid == Spawn)
{
TextDrawHideForPlayer(playerid,SoldierBox);
TextDrawHideForPlayer(playerid,SoldierInfo);
TextDrawHideForPlayer(playerid,Spawn);
pawnPlayer(playerid);
CancelSelectTextDraw(playerid);
}
else if(clickedid == Text:INVALID_TEXT_DRAW) SelectTextDraw(playerid,COLOR_RED);//If it is not working try SetTimerEx here, with internel of like 500 miliseconds//
return 1;
}