SA-MP Forums Archive
ERROR!!!!!! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: ERROR!!!!!! (/showthread.php?tid=411041)



ERROR!!!!!! - shoaib_sait - 27.01.2013

I GOT THSI ERROR IN ZCMD

pawn Код:
CMD:respawnall(playerid,params[])
{  
    // Check if the player has logged in
    if (APlayerData[playerid][LoggedIn] == true)
    {
        if(APlayerData[playerid][PlayerLevel] >= 3)
        {
            for(new vid = 1; vid <= 1999; vid++)
            {
            if(IsVehicleEmpty(vid)) SetVehicleToRespawn(vid);
            }
            SendClientMessageToAll(0x00FF00FF, "All vehicles have been used by the staff respawn");
        }
        else
            return 0;
    }
    else
        return 0;
       
    return 1;
}

this is the error : if(IsVehicleEmpty(vid))

undefined symbol


Re: ERROR!!!!!! - Mr.Anonymous - 27.01.2013

- nvm -


Re: ERROR!!!!!! - SchurmanCQC - 27.01.2013

do it in tags like this:

[pawn]
CODE HERE
[/pawn]


Re: ERROR!!!!!! - CJay9209 - 27.01.2013

This should fix your issue:

pawn Код:
CMD:respawnall(playerid,params[])
{
    if (APlayerData[playerid][LoggedIn] == true) {
        if(APlayerData[playerid][PlayerLevel] >= 3) {
            for(new vid = 1; vid <= 1999; vid++) {
                if(IsVehicleEmpty(vid)) SetVehicleToRespawn(vid);
            }
            return SendClientMessageToAll(0x00FF00FF, "All empty vehicles have been respawned by server staff");
        }
        return SendClientMessageToAll(0x00FF00FF, "You are not a high enough player level to use this command");
    }
    return SendClientMessageToAll(0x00FF00FF, "You must be logged in to use this command");
}
thats way more efficient and tidy than what ya had.


AW: ERROR!!!!!! - Blackazur - 27.01.2013

Код:
CMD:respawnall(playerid,params[])
{
// Check if the player has logged in
    if (APlayerData[playerid][LoggedIn] == true) {
        if(APlayerData[playerid][PlayerLevel] >= 3) {
            for(new vid = 1; vid <= 1999; vid++) {
                if(IsVehicleEmpty(vid)) SetVehicleToRespawn(vid);
            }
            return SendClientMessageToAll(0x00FF00FF, "All empty vehicles have been respawned by server staff");
        }
        return SendClientMessageToAll(0x00FF00FF, "You are not a high enough player level to use this command");
    }
    return SendClientMessageToAll(0x00FF00FF, "You must be logged in to use this command");
}
Try that.


Re: ERROR!!!!!! - CJay9209 - 27.01.2013

I also just realised that IsVehicleEmpty is not a native sa-mp function so you'll hav to add it:

pawn Код:
stock IsVehicleEmpty(carid)
{
    for(new i = 0; i < MAX_PLAYERS; i++) {
        if(IsPlayerConnected(i)) {
            if(IsPlayerInVehicle(i, carid)) return 0;
    }
    return 1;
}



Re: ERROR!!!!!! - shoaib_sait - 28.01.2013

Thanks all +1 rep for all