SA-MP Forums Archive
How do i make a Spawn car command only or a certain worldid? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How do i make a Spawn car command only or a certain worldid? (/showthread.php?tid=160141)



How do i make a Spawn car command only or a certain worldid? - markjaysonpinoy - 15.07.2010

Like spawn a car using /v only on world 1 but it will not apply on world 0, how can i do that? also can you please tell me how to auto repair a vehicle on certain world like autorepair on world 1 only?


Re: How do i make a Spawn car command only or a certain worldid? - DJDhan - 15.07.2010

SetVehicleVirtualWorld

Under your spawn car command:

Код:
new vw = GetPlayerVirtualWorld(playerid);
//create vehicle

SetVehicleVirtualWorld(vehicleid,vw);
The above code will check which virtual world the player is in and then set the virtual world of the vehicle to the same virtual world.


Re: How do i make a Spawn car command only or a certain worldid? - felipex - 15.07.2010

Код:
public OnPlayerUpdate(playerid)
{
new Float:health;
    new veh;
    veh = GetPlayerVehicleID(playerid);
    GetVehicleHealth(veh, health);
    if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
    RepairVehicle(GetPlayerVehicleID(playerid));
    }
return 1;
}
auto repair


Re: How do i make a Spawn car command only or a certain worldid? - markjaysonpinoy - 15.07.2010

Thanks you guys are the best scripters!