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(playerid, params[])
{
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(playerid, pos[4]);
GetPlayerFacingAngle(playerid, pos[3]);
GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
//..
switch(params[0])
{
case 1:
{
if(GetPlayerMoney(playerid) < 1200000)
return SendClientMessage(playerid, 0, "You don't have enough cash to buy this car!");
vInfo[playerid][vehicle] = CreateVehicle(541, pos[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(playerid, 0, "You don't have enough cash to buy this car!");
vInfo[playerid][vehicle] = CreateVehicle(411, pos[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(playerid, 0, "You don't have enough cash to buy this car!");
vInfo[playerid][vehicle] = CreateVehicle(494, pos[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(playerid, 0, "You don't have enough cash to buy this car!");
vInfo[playerid][vehicle] = CreateVehicle(409, pos[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(playerid, 0, "You don't have enough cash to buy this car!");
vInfo[playerid][vehicle] = CreateVehicle(560, pos[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(playerid, 0, "You don't have enough cash to buy this car!");
vInfo[playerid][vehicle] = CreateVehicle(506, pos[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(playerid, 0, "You don't have enough cash to buy this car!");
vInfo[playerid][vehicle] = CreateVehicle(521, pos[0], pos[1], pos[2], pos[3], random(126), random(126), (60*60));
GivePlayerMoney(playerid, -5000000);
vInfo[playerid][model] = 521;
}
}
return true;
}