24.06.2012, 07:08
(
Последний раз редактировалось Swyft™; 24.06.2012 в 17:18.
)
Remove please
CMD:car(playerid, params[])
{
if(DMZone[playerid] == 1)
SendClientMessage(playerid, COLOR_RED,"ERROR: You are in a DM Zone, you must go /home and try again!");
SendClientMessage(playerid, COLOR_ORANGE,"USAGE: /car [name|id]");
//if(carspawn[playerid] == 1) return SendClientMessage(playerid, COLOR_RED,"ERROR: You already have a car spawned, you must /destroyveh first!");
if(carid == 544 || carid == 432 || carid == 601 || carid == 425 || carid == 476 || carid == 447 || carid == 520 || carid == 430 || carid == 464 || carid == 465 || carid == 501) return SendClientMessage(playerid, COLOR_RED, "ERROR: You may not spawn an armed or otherwise dangerous vehicle. If you were not trying to, try entering the full vehicle name.");
if(DMZone[playerid] == 0)
{
new vehid = GetVehicleModelIDFromName(params);
new vehicle = GetVehicleModelIDFromName(params);
if(!IsNumeric(params)) { // vehid = strval(params);
vehid = GetVehicleModelIDFromName(params);
}
if(IsNumeric(params)) vehid = strval(params);
if(vehid < 400 || vehid > 611)
SendClientMessage(playerid,COLOR_RED,"[ERROR] Vehicle ID cannot be below 400 or above 611 or false name given.");
new Float:x, Float:y, Float:z;
new Float:a,
string[128];
GetPlayerFacingAngle(playerid, a);
GetPlayerPos(playerid, x, y, z);
if(IsPlayerInAnyVehicle(playerid) == 1)
{
GetXYInFrontOfPlayer(playerid, x, y, 8);
}
else
{
GetXYInFrontOfPlayer(playerid, x, y, 5);
}
new in;
if(carspawn[playerid] == 1)
{
DestroyVehicle(carspawn[playerid]);
}
carspawn[playerid] = CreateVehicle(vehid, x, y, z, a+90, -1, -1, 999999999999999999999);
PutPlayerInVehicle(playerid,carspawn,0)
carspawn[playerid] = 1;
LinkVehicleToInterior(in, GetPlayerInterior(playerid));
if(!IsNumeric(params))
{
format(string, sizeof(string), "INFO: You have spawned a %s", aVehicleNames[vehicle - 400]);
SendClientMessage(playerid, COLOR_YELLOW, string);
carspawn[playerid] = 1;
}
if(IsNumeric(params))
{
format(string, sizeof(string), "INFO: You have spawned a %s", aVehicleNames[vehid - 400]);
SendClientMessage(playerid, COLOR_YELLOW, string);
}
}
return 1;
}