18.07.2014, 22:51
Quote:
PHP код:
|
Porem esta ocorrendo um erro quando do /v [nome do veiculo que eu desejo]
da erro aparece Comando invalido !
Comando :
pawn Код:
CMD:car(playerid, params[])
{
new String[128], nomecarro[35];
new Float:x, Float:y, Float:z;
if(sscanf(params, "s", nomecarro)) return SendClientMessage(playerid, Amarelo, "Use : /v [Nome do carro]");
new vehicle = GetVehicleModelIDFromName(nomecarro);
if(vehicle < 400 || vehicle > 611) return SendClientMessage(playerid, Vermelho, "Nome incorreto tente novamente !");
if(Veh[playerid][VehId] == -1)
{
new Float:a;
GetPlayerFacingAngle(playerid, a);
GetPlayerPos(playerid, x, y, z);
if(IsPlayerInAnyVehicle(playerid) == 1)
{
GetXYInFrontOfPlayer(playerid, x, y, 8);
}
else
{
GetXYInFrontOfPlayer(playerid, x, y, 5);
}
new PlayersVehicle = CreateVehicle(vehicle, x, y, z, a+90, -1, -1, -1);
Veh[playerid][VehId] = PlayersVehicle;
LinkVehicleToInterior(PlayersVehicle, GetPlayerInterior(playerid));
}
else
{
DestroyVehicle(Veh[playerid][VehId]);
new Float:a;
GetPlayerFacingAngle(playerid, a);
GetPlayerPos(playerid, x, y, z);
if(IsPlayerInAnyVehicle(playerid) == 1)
{
GetXYInFrontOfPlayer(playerid, x, y, 8);
}
else
{
GetXYInFrontOfPlayer(playerid, x, y, 5);
}
new PlayersVehicle = CreateVehicle(vehicle, x, y, z, a+90, -1, -1, -1);
Veh[playerid][VehId] = PlayersVehicle;
LinkVehicleToInterior(PlayersVehicle, GetPlayerInterior(playerid));
}
format(String, sizeof(String), "Voce criou um : %s", aVehicleNames[vehicle - 400]);
SendClientMessage(playerid,Verde, String);
return 1;
}