29.03.2011, 14:32
So i add label when you type /adminduty on your charter to have Admin is on duty ...
But whats wrong? label not working..
pawn Код:
new Text3D:label[MAX_PLAYERS];
pawn Код:
if(!strcmp(cmdtext, "/adminduty", true)) // By Johny and Zika
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " Morate se prvo prijaviti !");
return 1;
}
if(PlayerInfo[playerid][pAdmin] > 0)
{
if(AdminDuty[playerid] == 0)
{
AdminDuty[playerid] = 1;
SetPlayerArmour(playerid, 999);
SetPlayerHealth(playerid, 999);
SetPlayerColor(playerid,0xFF005FF);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "[ADMIN] [ID:%d]%s je na duznosti, kucajte /p [text] za pomoc", playerid, sendername);
ABroadCast(COLOR_YELLOW,string,1);
label[playerid] = Create3DTextLabel("Admin On Duty \n Do NOT Attack",0xFF000099,0,0,0,50,-1,1);
Attach3DTextLabelToPlayer(label[playerid], playerid, 0,0,0);
if(PlayerInfo[playerid][pAdmin] >= 1337)
{
for(new i = 0; i < sizeof(CarInfo); i++)
{
SetVehicleParamsForPlayer(i,playerid,0,0);
}
}
return 1;
}
else if(AdminDuty[playerid] == 1)
{
AdminDuty[playerid] = 0;
SetPlayerArmour(playerid, 0);
SetPlayerHealth(playerid, 100);
SetPlayerColor(playerid,TEAM_HIT_COLOR);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "[ADMIN] [ID:%d]%s vise nije na duznosti i mozda nece odgovarati na vasa pitanja", playerid, sendername);
ABroadCast(COLOR_YELLOW,string,1);
Delete3DTextLabel(label[playerid])
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Niste Admin !");
return 1;
}
}
return 1;
}