SA-MP Forums Archive
CMD:vehslot - 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)
+--- Thread: CMD:vehslot (/showthread.php?tid=615660)



CMD:vehslot - MrCallum - 25.08.2016

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?


Re: CMD:vehslot - DarkSkull - 25.08.2016

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


Re: CMD:vehslot - MrCallum - 25.08.2016

Could you make the Command if possible?


Re: CMD:vehslot - DeeadPool - 25.08.2016

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.