23.03.2015, 21:25
Bom galera tenho este comando , e ja coloquei para nao permitir certos veiculos , porem tenho um problema e so o jogador tambem digitar o id ? como vou fazer para bloquear ?
pawn Код:
CMD:car(playerid, params[])
{
GetPlayerHealth(playerid, Vida);
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(IsNumeric(params))
{
if(sscanf(params, "i", params[0])) return SendClientMessage(playerid, Amarelo, "Use: /Car [Name/Model ID]");
if(params[0] < 400 || params[0] > 611) return SendClientMessage(playerid, Vermelho, "[Info]: Model ID Invalid, Use: /Car [Model ID 400-611]");
CreateVehicleEx(playerid, params[0]);
}
else
{
new name_vehicle[30], i_create_vehicle;
if(sscanf(params, "s[30]", name_vehicle)) return SendClientMessage(playerid, Amarelo, "Use: /Car [Name/Model ID]");
i_create_vehicle = GetModelVehicle(name_vehicle);
if(i_create_vehicle < 400 || i_create_vehicle > 611) return SendClientMessage(playerid, Vermelho, "[Info]: Name Invalid, Use: /Car [Name Correct]");
if(i_create_vehicle == 425 || i_create_vehicle == 432 || i_create_vehicle == 447 || i_create_vehicle == 520) return SendClientMessage(playerid, Vermelho, "[Info]: Restricted Vehicle !");
CreateVehicleEx(playerid, i_create_vehicle);
}
}
return 1;
}