16.03.2011, 13:52
pawn Код:
new Text3D:aduty[MAX_PLAYERS];
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
DeletePlayer3DTextLabel(playerid,aduty[playerid]); // line 2480
return 1;
}
pawn Код:
public OnPlayerSpawn(playerid)
{
if(PInfo[playerid][Duty] == 1)
{
Attach3DTextLabelToPlayer(aduty[playerid], playerid, 0.0, 0.0, 0.7);
SetPlayerSkin(playerid, 217);
SetPlayerHealth(playerid, 10000);
GivePlayerWeapon(playerid, 38, 100000);
}
return 1;
}
pawn Код:
command(adminduty,playerid,params[])
{
if(PInfo[playerid][Level] >=1 || IsPlayerAdmin(playerid))
{
new name[MAX_PLAYER_NAME], string[128];
GetPlayerName(playerid,name,25);
ACMDM(playerid,"ADMINDUTY");
if(PInfo[playerid][Duty] == 0)
{
SetPlayerSkin(playerid,217);
GivePlayerWeapon(playerid,38,999999);
SetPlayerTeam(playerid, 0);
PInfo[playerid][Duty] = 1;
Adminduty = SetTimerEx("AdminDuty",500,true,"d",playerid);
format(string,sizeof(string),"Administrator %s is now on Admin Duty",name);
SendClientMessageToAll(RED,string);
aduty[playerid] = Create3DTextLabel("On-Duty admin, DO NOT ATTACK",RED,0.0,40.0,0.0,0.0,0);
Attach3DTextLabelToPlayer(aduty[playerid],playerid,0,5,0);
}
else
{
GivePlayerMoney(playerid,500);
ResetPlayerWeapons(playerid);
SetPlayerHealth(playerid,0);
PInfo[playerid][Duty] = 0;
format(string,sizeof(string),"Administrator %s is now off Admin Duty",name);
SendClientMessageToAll(RED,string);
DeletePlayer3DTextLabel(playerid,aduty[playerid]); //line 2798
KillTimer(Adminduty);
}
}
else return SendClientMessage(playerid,RED,"You are not a high enough level to use this command");
return 1;
}
Код:
C:\Users\Chris\Documents\Serv\Server\gamemodes\COS.pwn(2480) : warning 213: tag mismatch C:\Users\Chris\Documents\Serv\Server\gamemodes\COS.pwn(2798) : warning 213: tag mismatch