public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
if(clickedid == Text:INVALID_TEXT_DRAW) SelectTextDraw(playerid,COLOR_RED);
return 1;
}
Soldier = TextDrawCreate(275.021667, 179.666671, "Soldier"); TextDrawLetterSize(Soldier, 0.449999, 1.600000); TextDrawAlignment(Soldier, 1); TextDrawColor(Soldier, 8388863); TextDrawSetShadow(Soldier, 0); TextDrawSetOutline(Soldier, 1); TextDrawBackgroundColor(Soldier, 51); TextDrawFont(Soldier, 2); TextDrawSetProportional(Soldier, 1); JetTrooper = TextDrawCreate(254.406707, 210.000030, "Jet Trooper"); TextDrawLetterSize(JetTrooper, 0.458900, 1.611665); TextDrawAlignment(JetTrooper, 1); TextDrawColor(JetTrooper, 65535); TextDrawSetShadow(JetTrooper, 0); TextDrawSetOutline(JetTrooper, 1); TextDrawBackgroundColor(JetTrooper, 51); TextDrawFont(JetTrooper, 2); TextDrawSetProportional(JetTrooper, 1);
it still works,when i press esc then i am not able to select textdraw
Code:
Soldier = TextDrawCreate(275.021667, 179.666671, "Soldier"); TextDrawLetterSize(Soldier, 0.449999, 1.600000); TextDrawAlignment(Soldier, 1); TextDrawColor(Soldier, 8388863); TextDrawSetShadow(Soldier, 0); TextDrawSetOutline(Soldier, 1); TextDrawBackgroundColor(Soldier, 51); TextDrawFont(Soldier, 2); TextDrawSetProportional(Soldier, 1); JetTrooper = TextDrawCreate(254.406707, 210.000030, "Jet Trooper"); TextDrawLetterSize(JetTrooper, 0.458900, 1.611665); TextDrawAlignment(JetTrooper, 1); TextDrawColor(JetTrooper, 65535); TextDrawSetShadow(JetTrooper, 0); TextDrawSetOutline(JetTrooper, 1); TextDrawBackgroundColor(JetTrooper, 51); TextDrawFont(JetTrooper, 2); TextDrawSetProportional(JetTrooper, 1); |
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; }
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;
}
//Under OnPlayerSpawn (Add it at the bottom of the callback, cuz I think you are using custom class selection so it should not mess with it))//
CancelSelectTextDraw(playerid);