SA-MP Forums Archive
Car menu - 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: Car menu (/showthread.php?tid=71328)



Car menu - CAMERON_BANFIELD - 31.03.2009

hi, how do i make it so a player can only have have one vehicle so they cant spam the server, but they can change the vehicle that they have.
thanks
cameron


Re: Car menu - Weirdosport - 31.03.2009

Create an array, size MAX_PLAYERS.

Make a command that creates a vehicle, and saves the vehicle ID into the array, filed under the players playerid.

When they go to use the command, if the vehicleid isn't 0, make it DestroyVehicle(vehicleid), then spawn a new one as before. You can if you wish SetPlayerInVehicle.


Re: Car menu - CAMERON_BANFIELD - 31.03.2009

thanks!


Re: Car menu - CAMERON_BANFIELD - 31.03.2009

Quote:
Originally Posted by Weirdosport
Create an array, size MAX_PLAYERS.

Make a command that creates a vehicle, and saves the vehicle ID into the array, filed under the players playerid.

When they go to use the command, if the vehicleid isn't 0, make it DestroyVehicle(vehicleid), then spawn a new one as before. You can if you wish SetPlayerInVehicle.
Please could you show me how to script it?? im not a very good scripter
thanks!
Cameron


Re: Car menu - ICECOLDKILLAK8 - 31.03.2009

pawn Код:
// Top of script
new LastSpawnedCar[MAX_PLAYERS];

// OnPlayerConnect
LastSpawnedCar[playerid] = 0;

// Command
if(LastSpawnedCar[playerid] != 0)
{
  DestroyVehicle(LastSpawnedCar[playerid]);
}
LastSpawnedCar[playerid] = CreateVehicle(...,...,...,...,...,...,...);



Re: Car menu - CAMERON_BANFIELD - 31.03.2009

thankns man! your the best!


Re: Car menu - CAMERON_BANFIELD - 31.03.2009

i get 1 error

Код:
F:\samp-server\filterscripts\menu.pwn(59) : error 017: undefined symbol "playerid"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Errors.



Re: Car menu - CAMERON_BANFIELD - 31.03.2009

please help with error PLEASE!!!


Re: Car menu - Mrkrabz - 31.03.2009

It's not defined >.>

EDIT: If you are making a menu, you will have forward menu() at the top, Make sure its forward menu(playerid)
[/offtopic] Double post :O! Naughty


Re: Car menu - CAMERON_BANFIELD - 31.03.2009

dosnt work