ERROR!!!!!!
#1

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
Reply
#2

- nvm -
Reply
#3

do it in tags like this:

[pawn]
CODE HERE
[/pawn]
Reply
#4

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.
Reply
#5

Код:
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.
Reply
#6

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;
}
Reply
#7

Thanks all +1 rep for all
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)