24.12.2010, 23:12
Doesn't works. this is my full command:
pawn Код:
COMMAND:bagagliaio(playerid, params[])
{
new x_nr[128];
if(sscanf(params, "s[128]", x_nr)) SendClientMessage(playerid, COLOR_GREEN, "USA: /bagagliaio [info]");
else
{
if (PlayerInfo[playerid][pPlayerLogged] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: Devi Loggarti.");
if(strcmp(x_nr, "info", true) == 0)
{
new counter = 0;
new result;
new plyName[MAX_PLAYER_NAME];
GetPlayerName(playerid, plyName, MAX_PLAYER_NAME);
GiveNameSpace(plyName);
for(new i; i != MAX_VEHICLES; i++)
{
new dist = CheckPlayerDistanceToVehicle(3.5, playerid, i);
if(dist)
{
result = i;
counter++;
}
}
switch(counter)
{
case 0:
{
SendClientMessage(playerid, COLOR_GREY, " Non ci sono auto con Bagagliaio intorno a te!");
}
case 1:
{
if(IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid, COLOR_GREY, " Non puoi aprire il bagagliaio mentre sei in auto");
return 1;
}
if(OwnableVehicleID(result))
{
if(OwnableVehicle[result] == PlayerInfo[playerid][pCarKey1]) { return 0; }
else if(OwnableVehicle[result] == PlayerInfo[playerid][pCarkey2]) { return 0; }
else if(OwnableVehicle[result] == PlayerInfo[playerid][pCarkey3]) { return 0; }
else
{
SendClientMessage(playerid, COLOR_GREY, " Bagagliaio Chiuso !");
return 1;
}
}
if(IsNotAEngineCar(result))
{
SendClientMessage(playerid, COLOR_GREY, " Questo veicolo non ha un Bagagliaio !");
return 1;
}
default:
{
SendClientMessage(playerid, COLOR_GREY, " Ci sono troppe auto intorno");
return 1;
}
}
return 1;
}
}
}
return 1;
}