CMD:vehslot
#1

I need help, I have #MAX_PLAYERVEHICLES 8 defines so players can have 8 max vehicles and I want to make a command, CMD:vehslot to add an extra vehicle slot to their ID and it sticks, can anyone help?
Reply
#2

In that case, You should save the MAX_PLAYERVEHICLES in a config file and load it when the Filterscript initializes. And when you use the command vehslot, Update the variable and update the file so that it sticks
Reply
#3

Could you make the Command if possible?
Reply
#4

Nope.

Here you go:-
PHP код:
enum PlayerInfo
{
    
vehslot
};
new 
PlayerData[MAX_PLAYERS][PlayerInfo]; 
PHP код:
CMD:vehslot(playeridparmas[])
{
     if(
PlayerData[playerid][vehslot] == 8) return SendClientMessage(playerid, -1"You already have maximum number of vehicle slots!");
     
PlayerData[playerid][vehslot]++;
return 
1;

PHP код:
CMD:vehbuy(playeridparmas[])
{
     new 
vID;
     if(
PlayerData[playerid][vehslot] == ) return SendClientMessage(playerid, -1"You have no vehicle slots!");
     if(
PlayerData[playerid][vehslot] == ) return SendClientMessage(playerid, -1"You can only own 8 vehicles only!");
     if(
sscanf(parmas"u"vID)) return SendClientMessage(playerid, -1"/vehslot [vehicleid]");
     if(
vID 400 || vID 611) return SendClientMessage(playerid, -1"Invalid vehicle id!");
     if(
vID == 520) return SendClientMessage(playerid, -1"You can not buy this vehicle!");
     
     
PlayerData[playerid][vehslot]++;
     
SendClientMessage(playerid, -1"You successfully bought your own vehicle!");
     
     
     
     
return 
1;

It's Just an example how you can do it.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)