25.08.2016, 15:25
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?
enum PlayerInfo
{
vehslot
};
new PlayerData[MAX_PLAYERS][PlayerInfo];
CMD:vehslot(playerid, parmas[])
{
if(PlayerData[playerid][vehslot] == 8) return SendClientMessage(playerid, -1, "You already have maximum number of vehicle slots!");
PlayerData[playerid][vehslot]++;
return 1;
}
CMD:vehbuy(playerid, parmas[])
{
new vID;
if(PlayerData[playerid][vehslot] == 0 ) return SendClientMessage(playerid, -1, "You have no vehicle slots!");
if(PlayerData[playerid][vehslot] == 8 ) 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;
}