Help with script please.
#1

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

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.
Reply
#3

Here you go, please make all changes obvious so i can learn what you have done.

Thanks alot,
Josh
Reply
#4

PS use trucking heaven start dude.
Reply
#5

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.
Reply
#6

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.
Reply


Forum Jump:


Users browsing this thread: