How do i make a Spawn car command only or a certain worldid?
#1

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

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

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

Thanks you guys are the best scripters!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)