Car menu
#1

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

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

thanks!
Reply
#4

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

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

// OnPlayerConnect
LastSpawnedCar[playerid] = 0;

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

thankns man! your the best!
Reply
#7

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

please help with error PLEASE!!!
Reply
#9

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

dosnt work
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)