24.02.2015, 15:32
Code:
public OnPlayerClickTextDraw(playerid, Text:clickedid) { SelectTextDraw(playerid,COLOR_RED); if(_:clickedid != INVALID_TEXT_DRAW) { 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); } } } } if(clickedid == Spawn) { TextDrawHideForPlayer(playerid,SoldierBox); TextDrawHideForPlayer(playerid,SoldierInfo); TextDrawHideForPlayer(playerid,Spawn); SpawnPlayer(playerid); CancelSelectTextDraw(playerid); } return 1; }