06.02.2010, 04:51
ok, I'm having a lil problem with my /park command. When i /park it displays the messages as it suppose to but when i respawn the car it dosen't spawn at the spot it was parked at, Here is the command.
what i want it to do, Is when you /park then you respawn the car it will spawn at the place you /parked it at without restarts or anything
pawn Код:
if(strcmp(cmd, "/park", true) == 0)
{
if(PlayerInfo[playerid][pCKey] == 0)
{
SendClientMessage(playerid, COLOR_RED, "ERROR: You dont own a vehicle!");
return 1;
}
new carid = GetPlayerVehicleID(playerid);
new carid2 = GetPlayerVehicleID(playerid);
if(carid != carid2)
{
SendClientMessage(playerid, COLOR_RED, "ERROR: You are not in your vehicle");
return 1;
}
SendClientMessage(playerid, COLOR_GREEN, "Your car will now spawn here");
new Float: Carx, Float: Cary, Float: Carz, Float:Carr ;
GetVehiclePos(carid2, Carx, Cary, Carz);
GetVehicleZAngle(carid2, Carr);
CInfo[carid-1][cParkx] = Carx;
CInfo[carid-1][cParky] = Cary;
CInfo[carid-1][cParkz] = Carz;
CInfo[carid-1][cParkr] = Carr;
CInfo[carid-1][cNew] = 1;
OnPropUpdate();
return 1;
}