Vehicles Slots Per 1Player
#3

Quote:
Originally Posted by LEOTorres
Посмотреть сообщение
Something of this nature should be sufficient.

Код:
new vSlots[MAX_PLAYERS][5];

for (new x = 0; x < 5; x++)
{
	if (vSlots[playerid][x] == 0)
	{
		//store vehicle here
		break;
	}
}
PHP код:
enum InfoVehicles
{
    
vehicle,
    
model,
    
world,
    
interior,
    
Float:x_,
    
Float:y_,
    
Float:z_,
    
Float:angel_,
    
    
vehicle1,
    
model1,
    
world1,
    
interior1,
    
Float:x_1,
    
Float:y_1,
    
Float:z_1,
    
Float:angel_1,
    
    
vehicle2,
    
model2,
    
world2,
    
interior2,
    
Float:x_2,
    
Float:y_2,
    
Float:z_2,
    
Float:angel_2,
    
    
vehicle3,
    
model3,
    
world3,
    
interior3,
    
Float:x_3,
    
Float:y_3,
    
Float:z_3,
    
Float:angel_3,
    
    
vehicle4,
    
model4,
    
world4,
    
interior4,
    
Float:x_4,
    
Float:y_4,
    
Float:z_4,
    
Float:angel_4,
};
CMD:carsss(playeridparams[])
{
    if(
sscanf(params"i"params[0]))
        return 
SendClientMessage(playerid, -1"usage: /cars [vehicle 1-7].");
    if(
vInfo[playerid][vehicle] != 0)
    {
        
DestroyVehicle(vInfo[playerid][vehicle]);
    }
    
//..
    
new Float:pos[5];
    
GetVehicleZAngle(playeridpos[4]);
    
GetPlayerFacingAngle(playeridpos[3]);
    
GetPlayerPos(playeridpos[0], pos[1], pos[2]);
    
//..
    
switch(params[0])
    {
        case 
1:
        {
            if(
GetPlayerMoney(playerid) < 1200000)
                return 
SendClientMessage(playerid0"You don't have enough cash to buy this car!");
            
vInfo[playerid][vehicle] = CreateVehicle(541pos[0], pos[1], pos[2], pos[3], random(126), random(126), (60*60));
            
GivePlayerMoney(playerid, -1200000);
            
vInfo[playerid][model] = 541;
        }
        case 
2:
        {
            if(
GetPlayerMoney(playerid) < 1900000)
                return 
SendClientMessage(playerid0"You don't have enough cash to buy this car!");
            
vInfo[playerid][vehicle] = CreateVehicle(411pos[0], pos[1], pos[2], pos[3], random(126), random(126), (60*60));
            
GivePlayerMoney(playerid, -1900000);
            
vInfo[playerid][model] = 411;
        }
        case 
3:
        {
            if(
GetPlayerMoney(playerid) < 4000000)
                return 
SendClientMessage(playerid0"You don't have enough cash to buy this car!");
            
vInfo[playerid][vehicle] = CreateVehicle(494pos[0], pos[1], pos[2], pos[3], random(126), random(126), (60*60));
            
GivePlayerMoney(playerid, -4000000);
            
vInfo[playerid][model] = 494;
        }
        case 
4:
        {
            if(
GetPlayerMoney(playerid) < 22000)
                return 
SendClientMessage(playerid0"You don't have enough cash to buy this car!");
            
vInfo[playerid][vehicle] = CreateVehicle(409pos[0], pos[1], pos[2], pos[3], random(126), random(126), (60*60));
            
GivePlayerMoney(playerid, -22000);
            
vInfo[playerid][model] = 409;
        }
        case 
5:
        {
            if(
GetPlayerMoney(playerid) < 460000)
                return 
SendClientMessage(playerid0"You don't have enough cash to buy this car!");
            
vInfo[playerid][vehicle] = CreateVehicle(560pos[0], pos[1], pos[2], pos[3], random(126), random(126), (60*60));
            
GivePlayerMoney(playerid, -460000);
            
vInfo[playerid][model] = 560;
        }
        case 
6:
        {
            if(
GetPlayerMoney(playerid) < 600000)
                return 
SendClientMessage(playerid0"You don't have enough cash to buy this car!");
            
vInfo[playerid][vehicle] = CreateVehicle(506pos[0], pos[1], pos[2], pos[3], random(126), random(126), (60*60));
            
GivePlayerMoney(playerid, -600000);
            
vInfo[playerid][model] = 506;
        }
        case 
7:
        {
            if(
GetPlayerMoney(playerid) < 5000000)
                return 
SendClientMessage(playerid0"You don't have enough cash to buy this car!");
            
vInfo[playerid][vehicle] = CreateVehicle(521pos[0], pos[1], pos[2], pos[3], random(126), random(126), (60*60));
            
GivePlayerMoney(playerid, -5000000);
            
vInfo[playerid][model] = 521;
        }
    }
    return 
true;

can you example it to me please!!
Reply


Messages In This Thread
Vehicles Slots Per 1Player - by se3a - 06.04.2017, 10:35
Re: Vehicles Slots Per 1Player - by LEOTorres - 06.04.2017, 10:54
Re: Vehicles Slots Per 1Player - by se3a - 06.04.2017, 11:04
Re: Vehicles Slots Per 1Player - by DarkSkull - 06.04.2017, 13:45
Re: Vehicles Slots Per 1Player - by se3a - 06.04.2017, 14:45
Re: Vehicles Slots Per 1Player - by DarkSkull - 06.04.2017, 15:50
Re: Vehicles Slots Per 1Player - by se3a - 06.04.2017, 16:34
Re: Vehicles Slots Per 1Player - by DarkSkull - 06.04.2017, 17:01
Re: Vehicles Slots Per 1Player - by se3a - 06.04.2017, 17:05
Re: Vehicles Slots Per 1Player - by DarkSkull - 06.04.2017, 17:07

Forum Jump:


Users browsing this thread: 3 Guest(s)