14.10.2013, 17:26
how can i make so message appears. "Theres an admin reconed on this person" so they cant be 10 admins reconed on one person..
PHP код:
if(strcmp(cmd, "/recon", true) == 0)
{
if(PlayerInfo[playerid][pAdmin] >= 1 || IsPlayerAdmin(playerid))
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext,idx);
if(!strlen(tmp))
{
SendClientMessage(playerid,COLOR_GREY," /recon [playerid]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(ReconO[giveplayerid] == 1)
{
SendClientMessage(playerid,COLOR_YELLOW,"Ce faci ma?");
return 1;
}
if(GetPlayerState(giveplayerid) == 1)
{
SetPlayerInterior(playerid,GetPlayerInterior(giveplayerid));
SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(giveplayerid));
TogglePlayerSpectating(playerid, 1);
PlayerSpectatePlayer(playerid, giveplayerid);
PlayerSpectateID[playerid] = giveplayerid;
PlayerSpec[giveplayerid] = playerid;
}
else if(GetPlayerState(giveplayerid) == 2)
{
SetPlayerInterior(playerid,GetPlayerInterior(giveplayerid));
SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(giveplayerid));
new idid = GetPlayerVehicleID(giveplayerid);
TogglePlayerSpectating(playerid, 1);
PlayerSpectateVehicle(playerid, idid);
GetPlayerPos(playerid,Pos[playerid][0],Pos[playerid][1],Pos[playerid][2]);
GetPlayerFacingAngle(playerid,Pos[playerid][3]);
PlayerSpectateID[playerid] = giveplayerid;
PlayerSpec[giveplayerid] = playerid;
}
else if(GetPlayerState(giveplayerid) == 3)
{
SetPlayerInterior(playerid,GetPlayerInterior(giveplayerid));
SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(giveplayerid));
new idid = GetPlayerVehicleID(giveplayerid);
TogglePlayerSpectating(playerid, 1);
GetPlayerPos(playerid,Pos[playerid][0],Pos[playerid][1],Pos[playerid][2]);
GetPlayerFacingAngle(playerid,Pos[playerid][3]);
PlayerSpectateVehicle(playerid, idid);
PlayerSpectateID[playerid] = giveplayerid;
PlayerSpec[giveplayerid] = playerid;
}
else
{
SendClientMessage(playerid,COLOR_YELLOW,"Ce faci ma?");
}
}
}
return 1;
}