SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 14/10/2013, 05:26 PM   #1
Akcent_Voltaj
Gangsta
 
Join Date: Jul 2012
Posts: 943
Reputation: 17
Angry Recon Problem

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 Code:
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;
                    } 
__________________
93.119.26.225:7777



Don't Copy My Work!
PS: Am prea multi fani si lumea ma copiaza
Akcent_Voltaj is offline   Reply With Quote
Old 14/10/2013, 06:07 PM   #2
Akcent_Voltaj
Gangsta
 
Join Date: Jul 2012
Posts: 943
Reputation: 17
Default Re: Recon Problem

anyone help plz?
__________________
93.119.26.225:7777



Don't Copy My Work!
PS: Am prea multi fani si lumea ma copiaza
Akcent_Voltaj is offline   Reply With Quote
Old 15/10/2013, 11:29 AM   #3
Akcent_Voltaj
Gangsta
 
Join Date: Jul 2012
Posts: 943
Reputation: 17
Default Re: Recon Problem

24/24 hours paasted anyone help??
__________________
93.119.26.225:7777



Don't Copy My Work!
PS: Am prea multi fani si lumea ma copiaza
Akcent_Voltaj is offline   Reply With Quote
Old 15/10/2013, 11:41 AM   #4
[KHK]Khalid
Gangsta
 
[KHK]Khalid's Avatar
 
Join Date: Jan 2012
Location: Alexandria, Egypt
Posts: 874
Reputation: 136
Default Re: Recon Problem

Code:
// 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!
[KHK]Khalid is offline   Reply With Quote
Old 15/10/2013, 11:47 AM   #5
Akcent_Voltaj
Gangsta
 
Join Date: Jul 2012
Posts: 943
Reputation: 17
Default Re: Recon Problem

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! "
__________________
93.119.26.225:7777



Don't Copy My Work!
PS: Am prea multi fani si lumea ma copiaza
Akcent_Voltaj is offline   Reply With Quote
Old 15/10/2013, 01:54 PM   #6
Akcent_Voltaj
Gangsta
 
Join Date: Jul 2012
Posts: 943
Reputation: 17
Default Re: Recon Problem

ok answer?
__________________
93.119.26.225:7777



Don't Copy My Work!
PS: Am prea multi fani si lumea ma copiaza
Akcent_Voltaj is offline   Reply With Quote
Old 15/10/2013, 03:13 PM   #7
Akcent_Voltaj
Gangsta
 
Join Date: Jul 2012
Posts: 943
Reputation: 17
Default Re: Recon Problem

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! "
__________________
93.119.26.225:7777



Don't Copy My Work!
PS: Am prea multi fani si lumea ma copiaza
Akcent_Voltaj is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Recon - Uncon problem FL3GM4 Scripting Help 3 18/12/2012 09:50 AM
/recon System12 Scripting Help 3 21/05/2012 04:42 AM
Tom Clancy's Ghost Recon Online Beta Key giveaway iNorton Everything and Nothing 21 19/04/2012 03:49 PM
Recon Help! Dan_Barocu Scripting Help 4 08/04/2012 03:38 AM
Need Help with Making a Recon Plane JonnyDeadly Help Archive 3 17/04/2011 11:18 AM


All times are GMT. The time now is 12:13 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.