Recon Problem
#1

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] >= || 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(playerid1);
                                    
PlayerSpectatePlayer(playeridgiveplayerid);
                                    
PlayerSpectateID[playerid] = giveplayerid;
                                    
PlayerSpec[giveplayerid] = playerid;
                                }
                                else if(
GetPlayerState(giveplayerid) == 2)
                                {
                                    
SetPlayerInterior(playerid,GetPlayerInterior(giveplayerid));
                                    
SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(giveplayerid));
                                    new 
idid GetPlayerVehicleID(giveplayerid);
                                    
TogglePlayerSpectating(playerid1);
                                    
PlayerSpectateVehicle(playerididid);
                                    
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(playerid1);
                                    
GetPlayerPos(playerid,Pos[playerid][0],Pos[playerid][1],Pos[playerid][2]);
                                    
GetPlayerFacingAngle(playerid,Pos[playerid][3]);
                                    
PlayerSpectateVehicle(playerididid);
                                    
PlayerSpectateID[playerid] = giveplayerid;
                                    
PlayerSpec[giveplayerid] = playerid;
                                }
                                else
                                {
                                    
SendClientMessage(playerid,COLOR_YELLOW,"Ce faci ma?");
                                }
                            }
                        }
                        return 
1;
                    } 
Reply
#2

anyone help plz?
Reply
#3

24/24 hours paasted anyone help??
Reply
#4

pawn Код:
// Global var
new PlayerReconedBy[MAX_PLAYERS];

// Command
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(IsPlayerConnected(PlayerReconedBy[giveplayerid]))
            {
                // ERROR
                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;
                PlayerReconedBy[giveplayerid] = playerid; // added
            }
            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;
                PlayerReconedBy[giveplayerid] = playerid; // added
            }
            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;
                PlayerReconedBy[giveplayerid] = playerid; // added
            }
            else
            {
                SendClientMessage(playerid,COLOR_YELLOW,"Ce faci ma?");
            }
        }
    }
    return 1;
}
Remember to reset PlayerReconedBy when needed!
Reply
#5

so if an admin is with /recon on somebody he gets message.."someone is with recon on this person" ??

and i dont understand what u mean "Remember to reset PlayerReconedBy when needed! "
Reply
#6

ok answer?
Reply
#7

dosent work..on each player that i type /recon.. dosent work..

PSo look if u dont understand look " %s is already with recon on this person! "
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)