Help with /tune 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)
+--- Thread: Help with /tune command! (
/showthread.php?tid=595233)
Help with /tune command! -
Dragonic - 30.11.2015
Right... So I'm trying to create a /tune command that based on what vehicle your at it'll teleport you to the right tunning place.
Here's the code:
Код:
CMD:tune(playerid, params)
{
new vehicleid = GetVehicleModel(vehicleid);
if(vehicleid == 411)
{
new vh = GetPlayerVehicleID(playerid);
SetVehiclePos(vh, -1935.4719, 229.8815, 34.2646);
PutPlayerInVehicle(playerid, vh, 0);
GameTextForPlayer(playerid," ~y~Transfender", 4000, 6);
}
else if(vehicleid == 562)
{
new vh = GetPlayerVehicleID(playerid);
SetVehiclePos(vh, -2706.2625, 216.9816, 4.1894);
PutPlayerInVehicle(playerid,vh, 0);
GameTextForPlayer(playerid,"~y~Wheels Arch Angels", 4000, 6);
}
return 1;
}
It has no erros/warnings during compile, but when I type "/tune" in-game nothing happens...
Re: Help with /tune command! -
rymax99 - 30.11.2015
You created the variable 'vehicleid' to get the vehicle model of the same variable you just created, which would be 0 since you didn't assign it a value.
Код:
new vehicleid = GetVehicleModel(GetPlayerVehicleID(playerid));
Re: Help with /tune command! -
Dragonic - 30.11.2015
Oh, thanks for the hand lol.... It's been a while since I played with Pawn so I forgot most of the stuff