07.05.2009, 16:16
pawn Код:
//TOP of script
forward NameOff(playerid);
forward NameOn(playerid);
public NameOff(playerid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
ShowPlayerNameTagForPlayer(playerid,i, false);
return 1;
}
public NameOn(playerid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
ShowPlayerNameTagForPlayer(playerid,i,true);
return 1;
}
if(strcmp(cmd,"/name",true)==0)
{
if(IsPlayerConnected(playerid))
{
new x_job[256];
x_job = strtok(cmdtext, idx);
if(!strlen(x_job)) {
SendClientMessage(playerid,COLOR_WHITE,"USAGE: /name ON/OFF");
return 1;
}
if(strcmp(x_job,"off",true) == 0)
{
NameOff(playerid);
PlayerInfo[playerid][pTags] = 1;
SendClientMessage(playerid,COLOR_LIGHTRED,"[Name] Your name tag has been hidden.");
GameTextForPlayer(playerid, "~r~Showname off", 600, 1);
}
else if(strcmp(x_job,"on",true) == 0)
{
NameOn(playerid);
PlayerInfo[playerid][pTags] = 0;
SendClientMessage(playerid,COLOR_LIGHTRED,"[Name] Your name tag has been unhidden.");
GameTextForPlayer(playerid, "~r~Showname on", 600, 1);
}
}
return 1;
}