Need a lil help with my park command
#1

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.

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;
}
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
Reply
#2

Ok. 2 questions for you:
here
Код:
new carid = GetPlayerVehicleID(playerid);
new carid2 = GetPlayerVehicleID(playerid);
if(carid != carid2)
What are you doing, carid will always == carid2 because they are the same command.

And where is your /parked command?
Reply
#3

I got it working, I changed

the new carid to

new carid = PlayerInfo[playerid][pCKey];

and it works fine now
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)