Car Respawns?
#1

Recently, we have added a 'Car Jacker' Class to our server. The point of this class is to hotwire, and drive a player owned car to a checkpoint where the car is sold. This all works great, except for when we need the car to respawn...it never comes. The code is below, please let me know if there is any error, or if you need more information, thank you.

pawn Код:
if(IsPlayerInStolenCar[playerid] == 1) {
    stolencar[playerid] = GetPlayerVehicleID(playerid);
    SendClientMessage(playerid, 0xA9A9A9AA, "|_Car Sold_|");
    SendClientMessage(playerid,0x00C7FFAA,"You have sold a stolen car for $75000");
    GivePlayerMoney(playerid,75000);
    RemovePlayerFromVehicle(playerid);
    new playerScore = GetPlayerScore(playerid);
    SetPlayerScore(playerid, playerScore+ 1);
    DestroyVehicle(stolencar[playerid]);
    SetVehicleToRespawn(stolencar[playerid]);
Reply
#2

Quote:
Originally Posted by Rhemsis
Recently, we have added a 'Car Jacker' Class to our server. The point of this class is to hotwire, and drive a player owned car to a checkpoint where the car is sold. This all works great, except for when we need the car to respawn...it never comes. The code is below, please let me know if there is any error, or if you need more information, thank you.

pawn Код:
if(IsPlayerInStolenCar[playerid] == 1) {
    stolencar[playerid] = GetPlayerVehicleID(playerid);
    SendClientMessage(playerid, 0xA9A9A9AA, "|_Car Sold_|");
    SendClientMessage(playerid,0x00C7FFAA,"You have sold a stolen car for $75000");
    GivePlayerMoney(playerid,75000);
    RemovePlayerFromVehicle(playerid);
    new playerScore = GetPlayerScore(playerid);
    SetPlayerScore(playerid, playerScore+ 1);
    //DestroyVehicle(stolencar[playerid]);
    SetVehicleToRespawn(stolencar[playerid]);
Don't destroy, only set vehicle to respawn.
Reply
#3

Lol thanks for your reply, I actually had just tried that before I read your post, but again, Thank you very much for your help.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)