[HELP] Respawn cars
#1

Код:
if(strcmp(cmd, "/respawncars", true) == 0)
    {
            for(new i=0;i<MAX_VEHICLES;i++)
            {
                if(IsVehicleOccupied(i) == 0)
                {
                    SetVehicleToRespawn(i);
                }
            }
        return 1;
    }
Me shows this error:

Код:
C:\Documents and Settings\Admin\Desktop\FunZoneLT\gamemodes\FreeRoamLT.pwn(11590) : error 017: undefined symbol "IsVehicleOccupied"
Reply
#2

pawn Код:
if(strcmp(cmd, "/respawncars", true) == 0)
    {
            new IsVehicleOccupied;
            IsVehicleOccupied = if(IsPlayerInVehicle);
            for(new i=0;i<MAX_VEHICLES;i++)
            {
                if(IsVehicleOccupied(i) == 0)
                {
                    SetVehicleToRespawn(i);
                }
            }
        return 1;
    }

Try that
Reply
#3

OMG


Код:
C:\Documents and Settings\Admin\Desktop\FunZoneLT\gamemodes\FreeRoamLT.pwn(11589) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Admin\Desktop\FunZoneLT\gamemodes\FreeRoamLT.pwn(11589) : error 076: syntax error in the expression, or invalid function call
C:\Documents and Settings\Admin\Desktop\FunZoneLT\gamemodes\FreeRoamLT.pwn(11589) : warning 215: expression has no effect
C:\Documents and Settings\Admin\Desktop\FunZoneLT\gamemodes\FreeRoamLT.pwn(11592) : error 012: invalid function call, not a valid address
C:\Documents and Settings\Admin\Desktop\FunZoneLT\gamemodes\FreeRoamLT.pwn(11592) : warning 215: expression has no effect
C:\Documents and Settings\Admin\Desktop\FunZoneLT\gamemodes\FreeRoamLT.pwn(11592) : error 001: expected token: ";", but found ")"
C:\Documents and Settings\Admin\Desktop\FunZoneLT\gamemodes\FreeRoamLT.pwn(11592) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Admin\Desktop\FunZoneLT\gamemodes\FreeRoamLT.pwn(11592) : fatal error 107: too many error messages on one line
Reply
#4

What is this method "SetVehicleToRespawn"?
Reply
#5

Well,Hallman,SetVehicleToRespawn is a method officially recognized by SAMP comunity and Wikipedia,face that?
Reply
#6

try this
pawn Код:
if(strcmp(cmd, "/respawncars", true) == 0)
{
    new bool:vehicleused[MAX_VEHICLES];
    for(new i=0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i))
        {
            vehicleused[GetPlayerVehicleID(i)] = true;
        }
    }
    for(new i=1; i < MAX_VEHICLES; i++)
    {
        if(!vehicleused[i])
        {
            SetVehicleToRespawn(i);
        }
    }
}
Reply
#7

helped me alot
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)