21.06.2011, 08:27
i tried many ways but nothing. I also made new system that saves vehicle Virtualworld into cars.cfg when i use /v park.
This is my code :
CarInfo[carid][cVw]); is saved virtualworld for car in cars.cfg. When i type /rtc i want it to getvehiclevirtualworld from [cVw] and SetVehicleToRespawn with this virtualworld but it spawns my car in virtualworld that i'm currently in.
This is my code :
pawn Код:
if(strcmp(cmd, "/respawnthiscar", true) == 0 || strcmp(cmd, "/rtc", true) == 0) //by Ellis
{
new carid;
if(IsPlayerConnected(playerid))
if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { carid = PlayerInfo[playerid][pPcarkey]; }
else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { carid = PlayerInfo[playerid][pPcarkey2]; }
else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3]) { carid = PlayerInfo[playerid][pPcarkey3]; }
else { return 1; }
{
if(PlayerInfo[playerid][pAdmin] < 2 )
{
SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command!");
return 1;
}
if(IsPlayerInAnyVehicle(playerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, 256, "[ADMIN] %s has just respawned vehicle id %d.",sendername,GetPlayerVehicleID(playerid));
ABroadCast(COLOR_YELLOW,string,1);
SetVehicleToRespawn(GetPlayerVehicleID(playerid));
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_GREY, " Vehicle Respawned !");
SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), CarInfo[carid][cVw]);
}
}
return 1;
}