Help with script please. - 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: Help with script please. (
/showthread.php?tid=82713)
Help with script please. -
Bofhead - 20.06.2009
Ok two things i can't figure out.
1) No matter if i use Addstaticvehicle or CreateVehicle when i destroyvehicle they don't respwan.
2) How do i destroy the trailer the truck is towing after some advice i have created array and gone Trailler[1] = AddStatiVehicle e.t.c but when i enter checkpoint (see code below) i need to figure out which trailer i am towing, i don't want to have to destroy them all.
Код:
public OnPlayerEnterCheckpoint(playerid) {
new vehicleid=GetPlayerVehicleID( playerid );
if (IsPlayerInVehicle(playerid,vehicleid) ) {
if ( IsTrailerAttachedToVehicle(vehicleid) )
{
GameTextForPlayer(playerid, "~r~Congratulations! Here, have 5k", 2000, 3);
GivePlayerMoney(playerid, 5000);
DisablePlayerCheckpoint(playerid);
RemovePlayerFromVehicle(playerid);
DestroyVehicle(vehicleid);
DestroyVehicle(Trailer[0]);
}
else {
GameTextForPlayer(playerid, "~r~You need a trailer. Noob", 2000, 3);
}}
else { DisablePlayerCheckpoint(playerid);
}
return 1;
}
Thanks in advance,
Josh
Re: Help with script please. -
Abernethy - 20.06.2009
Got a working server that I can test it on, you've got a lot of questions & I think I need to test the GM myself.
Re: Help with script please. -
Bofhead - 20.06.2009
Here you go, please make all changes obvious so i can learn what you have done.
Thanks alot,
Josh
Re: Help with script please. -
Bofhead - 20.06.2009
PS use trucking heaven start dude.
Re: Help with script please. -
Abernethy - 20.06.2009
Alright, I'm going to fuck around with your script for a while. It should be working within the hour, depends how it goes. Could only be 5 minutes, never know.Working, upload soon.
Re: Help with script please. -
Abernethy - 20.06.2009
FIXED:
- Instead of destroying the Truck + Trailer I respawned them. I made all trailers respawn, fixed the Trailers[10] when there was only 2 trailers.
- Tidied up the script, it was very messy.
- Changed some of the text, & added a little credits.
By the way, if you're getting to know the Pawno language I suggest you learn about pickups if you haven't already. They're a very, very useful tool.