31.01.2017, 08:15
(
Последний раз редактировалось Hunud; 31.01.2017 в 09:16.
)
/////////////// do ne
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;
}