anyone able to help me with a command
#1

when i use this command it says that is doesnt exist ... but it works only sometimes then it will say that it doesnt work the coding is here for the command


PHP код:
CMD:backup(playeridparams[])
{
    if(
IsACop(playerid) || PlayerInfo[playerid][pFaction] == && PlayerInfo[playerid][pDivision] == || PlayerInfo[playerid][pFaction] == && PlayerInfo[playerid][pRank] >= 5)
    {
        if(
Backup[playerid] != 1)
        {
            new
                
zone[MAX_ZONE_NAME],
                
string[40 MAX_PLAYER_NAME];
            
GetPlayer3DZone(playeridzonesizeof(zone));
            
format(stringsizeof(string), "* %s requests backup over their radio."GetPlayerNameEx(playerid));
            
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            
format(stringsizeof(string), "%s is requesting immediate backup at %s."GetPlayerNameEx(playerid), zone);
            
Backup[playerid] = 1;
            foreach(
Playeri)
            {
                if(
IsACop(i))
                {
                      
SetPlayerMarkerForPlayer(iplayerid0x2641FEAA);
                    
SendClientMessage(iTEAM_BLUE_COLORstring);
                }
            }
            
SendClientMessage(playeridCOLOR_WHITE"Type /nobackup to clear your backup request.");
            
SetTimerEx("BackupClear"180000false"ii"playerid1);
        }
        else
        {
            
SendClientMessage(playeridCOLOR_GREY"  You already have an active backup request!");
        }
    }
    else
    {
        
SendClientMessage(playeridCOLOR_GRAD2"   You're not a Cop / FBI / Coastguard!");
    }
    return 
1;

Reply
#2

Private message me i will fix your code
Reply
#3

not tested

PHP код:
CMD:backup(playeridparams[])
{
    if(
IsACop(playerid) || PlayerInfo[playerid][pFaction] == && PlayerInfo[playerid][pDivision] == || PlayerInfo[playerid][pFaction] == && PlayerInfo[playerid][pRank] >= 5)
    {
    if(
Backup[playerid] = 0)
    {
        new
        
zone[MAX_ZONE_NAME],
        
string[40 MAX_PLAYER_NAME];
        
GetPlayer3DZone(playeridzonesizeof(zone));
        
format(stringsizeof(string), "* %s requests backup over their radio."GetPlayerNameEx(playerid));
        
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
        
format(stringsizeof(string), "%s is requesting immediate backup at %s."GetPlayerNameEx(playerid), zone);
        
Backup[playerid] = 1;
        foreach(
Playeri)
        if(
IsACop(i))
        {
            
SetPlayerMarkerForPlayer(iplayerid0x2641FEAA);
            
SendClientMessage(iTEAM_BLUE_COLORstring);
            
SendClientMessage(iCOLOR_WHITE"Type /nobackup to clear your backup request.");
            
SetTimerEx("BackupClear"180000false"ii"playerid1);
        }
          return 
1;
    }
    if(
Backup[playerid] == 1)
    {
        
SendClientMessage(playeridCOLOR_GREY" You already have an active backup request!");
          }
    }
    return 
1;

Reply
#4

Only thing I can think of that would be causing this is the IsACop function. Can you post that? Try running it again with the crashdetect plugin and see what your console/log says.

Also I don't know if this was like this or maybe you pasted it wrong, but:
PHP код:
COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE 
There's a space before the E.

Quote:
Originally Posted by Zmith
not tested
Nigga... you didn't even 'compile' it...
Reply
#5

This is the isacop ..
IsACop(playerid)
{
if(IsPlayerConnected(playerid))
{
new leader = PlayerInfo[playerid][pLeader];
new member = PlayerInfo[playerid][pFaction];
if(member==1 || member==2 || member==6 || member==7)
{
return 1;
}
else if(leader==1 || leader==2 || leader==6 || leader==7)
{
return 1;
}
}
return 0;
}
Reply
#6

anyone ??
Reply
#7

Have you tried running crashdetect?
https://github.com/Zeex/samp-plugin-...18.1-win32.zip
Reply
#8

Can you make your code more readable and put it in a [php]?
Reply
#9

but the command doesnt crash just stops working after a amount of time the server has started ...... if i start the server and join it works ....... if a later on join it doesnt work at all says the command doesnt exist ..... What do you mean Readable ?... php ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)