25.03.2012, 14:47
So, i have this afk command and works find it adds the 3DText but when i type again afk it doesn't remove the 3DText. Once i tried with Delete3DTextLabel(label); but it failed now with this new version it gaves me tag mismatch
I searched on wiki but still didn't find a solution to fix it.
I searched on wiki but still didn't find a solution to fix it.
pawn Код:
CMD:afk(playerid, params[]){
new mystring[70], Text3D:label;
GetPlayerName(playerid, pname, sizeof(pname));
if(PlayerInfo[playerid][pAfk] == -1){
format(mystring, sizeof(mystring), "*{DDDDDD}%s {00FF00}is now away from keyboard!",pname);
SendClientMessageToAll(COLOR_LIME, mystring);
TogglePlayerControllable(playerid, 0);
PlayerInfo[playerid][pAfk] = 1;
label = Create3DTextLabel("I'm away from my keyboard!", 0x00FF00FF, 30.0, 40.0, 50.0, 40.0, 0);
Attach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.7);
}else{
format(mystring, sizeof(mystring), "*{DDDDDD}%s {88FF00}is now back to his keyboard!",pname);
SendClientMessageToAll(0x88FF00FF, mystring);
TogglePlayerControllable(playerid, 1);
PlayerInfo[playerid][pAfk] = -1;
DeletePlayer3DTextLabel(playerid, label); //warning 213:tag mismatch
}
return 1;
}