Recon Problem
#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


Messages In This Thread
Recon Problem - by Akcent_Voltaj - 14.10.2013, 17:26
Re: Recon Problem - by Akcent_Voltaj - 14.10.2013, 18:07
Re: Recon Problem - by Akcent_Voltaj - 15.10.2013, 11:29
Re: Recon Problem - by [KHK]Khalid - 15.10.2013, 11:41
Re: Recon Problem - by Akcent_Voltaj - 15.10.2013, 11:47
Re: Recon Problem - by Akcent_Voltaj - 15.10.2013, 13:54
Re: Recon Problem - by Akcent_Voltaj - 15.10.2013, 15:13

Forum Jump:


Users browsing this thread: 1 Guest(s)