17.08.2015, 07:33
I have a command /towcar when i write /towcar 1 for car 1 is working but when i write /towcar 2 for car 2 is saying: UNKNOW COMMAND
PHP код:
CMD:tracteaza(playerid, params[])
{
new string[144];
new CARID;
if(GetPlayerMoney(playerid) < 10) return SendClientMessage(playerid, -1, "Nu ai indeajuns bani!");
if(sscanf(params, "u", CARID)) return SendClientMessage(playerid, -1, "{FF0000}Folosire: /tracteaza [MASINA(1-2)]");
if(P_Data[playerid][pCar1] == 0 && P_Data[playerid][pCar2] == 0) return SendClientMessage(playerid, -1, "Nu ai masina!");
if(CARID > 3) return 1;
if(CARID == 1)
{
if(P_Data[playerid][pCar1] == 1)
{
foreach(Player, i)
{
if(IsPlayerInVehicle(i, masina[playerid]) == 1) return SendClientMessage(playerid, -1, "Masina in folosinta!");
}
DestroyVehicle(masina[playerid]);
masina[playerid] = CreateVehicle(P_Data[playerid][pCarID1], P_Data[playerid][pCarX1], P_Data[playerid][pCarY1], P_Data[playerid][pCarZ1], P_Data[playerid][pCarR1], P_Data[playerid][pCarColor11], P_Data[playerid][pCarColor21], -1);
P_Data[playerid][pCarKey1] = masina[playerid];
format(string, sizeof(string), "%s a fost tractat la locul de parcare!", VehicleNames[P_Data[playerid][pCarID1]-400]);
SendClientMessage(playerid, -1, string);
}
}
if(CARID == 2)
{
if(P_Data[playerid][pCar2] == 1)
{
foreach(Player, i)
{
if(IsPlayerInVehicle(i, masina2[playerid]) == 1) return SendClientMessage(playerid, -1, "Masina in folosinta!");
}
DestroyVehicle(masina2[playerid]);
masina2[playerid] = CreateVehicle(P_Data[playerid][pCarID2], P_Data[playerid][pCarX2], P_Data[playerid][pCarY2], P_Data[playerid][pCarZ2], P_Data[playerid][pCarR2], P_Data[playerid][pCarColor12], P_Data[playerid][pCarColor22], -1);
P_Data[playerid][pCarKey2] = masina2[playerid];
format(string, sizeof(string), "%s a fost tractat la locul de parcare!", VehicleNames[P_Data[playerid][pCarID2]-400]);
SendClientMessage(playerid, -1, string);
}
}
return 1;
}