31.01.2017, 09:00
Because your IF statement isn't the way it should be.
This should work:
'==' means if the player is in the 4th organization, return the error message.
'!=' means if the player is NOT in the 4th organization.
This should work:
PHP код:
YCMD:napuni(playerid, params[], help)
{
#pragma unused help
#pragma unused params
if(UlogovanProvera[playerid] == 0) return SCM(playerid,-1,CRVENA"ERROR: "BELA"Moras se ulogovati da bi koristio ovu komandu!");
if(PlayerInfo[playerid][pClan] != 4 || PlayerInfo[playerid][pLider] != 4) return SCM(playerid,-1,CRVENA"ERROR: "BELA"Niste clan Auto Moto saveza!");
if(IsPlayerInAnyVehicle(playerid)) return SCM(playerid, -1, CRVENA"ERROR: "BELA"Ne mozete to dok ste u vozilu!");
new id, cena, Float:Poz[3];
if(sscanf(params, "ui", id, cena)) return SCM(playerid, -1, SIVA"COMMAND: "CRVENA"/napuni [ID/Ime] [Cena goriva]");
if(!IsPlayerConnected(id)) return SCM(playerid, -1, CRVENA"ERROR: "BELA"Igrac je offline!");
GetPlayerPos(id, Poz[0], Poz[1], Poz[2]);
if(!IsPlayerInRangeOfPoint(playerid, 5.0, Poz[0], Poz[1], Poz[2])) return SCM(playerid, -1, CRVENA"ERROR: "BELA"Igrac nije blizu tebe!");
if(!IsPlayerInAnyVehicle(id)) return SCM(playerid, -1, CRVENA"ERROR: "BELA"Igrac mora biti u vozilu!");
if(GetPlayerState(id) != PLAYER_STATE_DRIVER) SCM(playerid, -1, CRVENA"ERROR: "BELA"Igrac mora biti vozac!");
if(cena > 3000) return SCM(playerid, -1, CRVENA"ERROR: "BELA"Cena goriva ne moze biti veca od 3000$!");
if(VoziloJeBicikla(GetVehicleModel(GetPlayerVehicleID(id)))) return SCM(playerid,-1,CRVENA"ERROR: "BELA"Ne mozete sipati gorivo u biciklo!");
PonudioGorivo[id] = playerid; CenaGoriva[id] = cena;
SCMF(playerid, -1, "BE | "HZELENA"Ponudili ste gorivo za vozilo igracu %s za %d$.", GetName(id), cena);
SCMF(id, -1, "BE | "HZELENA"AMS - Mehanicar %s vam je ponudio gorivo za vozila za %d$ | Da prihvatite /prihvati gorivo!", GetName(playerid), cena);
return 1;
}
'!=' means if the player is NOT in the 4th organization.