PHP код:
CMD:car(playerid, params[])
{
GetPlayerHealth(playerid, Vida);
new s;
if(IsNumeric(params[0])) {
if(Vida < 40.0)
return SendClientMessage(playerid, Vermelho, "[Info]: You can not use this Command With Low Life !");
if(GetPlayerInterior(playerid) != 0)
return SendClientMessage(playerid, Vermelho, "[Error]: You can not use Commands in an Interior !");
if(Duel[playerid] >=1)
return SendClientMessage(playerid, Vermelho,"[Error]: You can Not use Commands if you are in a Duel !");
if(IsPlayerInAnyVehicle(playerid))
return SendClientMessage(playerid, Vermelho, "[Info]: You are Already in a Vehicle !");
if(sscanf(params, "i", s))
return SendClientMessage(playerid, Amarelo, "Use: /Car [Name/Model ID]");
if(s < 400 ||s > 611)
return SendClientMessage(playerid, Vermelho, "[Info]: Model ID Invalid, Use: /Car [Model ID 400-611]");
if(s == 425 || s == 432 || s == 447 || s == 520)
return SendClientMessage(playerid, Vermelho, "[Info]: Restricted Vehicle !");
CreateVehicleEx(playerid, s);
return 1;
} else {
new vehName[30];
if(sscanf(params, "s[30]", vehName))
return SendClientMessage(playerid, Amarelo, "Use: /Car [Name/Model ID]");
s = GetModelVehicle(vehName);
if(s < 400 || s > 611)
return SendClientMessage(playerid, Vermelho, "[Info]: Name Invalid, Use: /Car [Name Correct]");
if(s == 425 || s == 432 || s == 447 || s == 520)
return SendClientMessage(playerid, Vermelho, "[Info]: Restricted Vehicle !");
CreateVehicleEx(playerid, s);
return 1;
}
return 1;
}