Need a lil help with my park command - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Need a lil help with my park command (
/showthread.php?tid=125874)
Need a lil help with my park command -
ihatetn931 - 06.02.2010
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
Re: Need a lil help with my park command -
mansonh - 06.02.2010
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?
Re: Need a lil help with my park command -
ihatetn931 - 06.02.2010
I got it working, I changed
the new carid to
new carid = PlayerInfo[playerid][pCKey];
and it works fine now