SA-MP Forums Archive
[HELP] Respawn cars - 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: [HELP] Respawn cars (/showthread.php?tid=333663)



[HELP] Respawn cars - V4at - 12.04.2012

Код:
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"



Re: [HELP] Respawn cars - Scripter12345 - 12.04.2012

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


Re : [HELP] Respawn cars - V4at - 12.04.2012

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



Re: [HELP] Respawn cars - HallmanS87 - 12.04.2012

What is this method "SetVehicleToRespawn"?


Re: [HELP] Respawn cars - Cjgogo - 12.04.2012

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


Re: [HELP] Respawn cars - emokidx - 12.04.2012

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);
        }
    }
}



Re: [HELP] Respawn cars - Stroon - 01.03.2014

helped me alot