[pomoc] Kako koristiti vise naredbe u return ();;;

Započeo [IF] mariomako, Maj 16, 2011, 17:32:31 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 5 gostiju pregledaju ovu temu.

Skriptu koju koristim: Moji gamemode od 0
Detaljan opis problema: Kako da koristim vise na redbe u ono return ;;;

Dio skripte: evo primer


CMD:makeadmin(playerid, params[])
{
if(GetPlayerAdminLevel(playerid) < 4) return SendClientMessage(playerid, COLOR_ORANGE, "[*] You're not a level 4 admin!"); // PRICAM ZA OVAJ OVAKVI RETURN
new target, level;
if(sscanf(params, "ui", target, level)) return SendClientMessage(playerid, COLOR_ORANGE, "[*] Usage: /makeadmin [playerid/name] [level]");
else if(target == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_ORANGE, "[*] Enter a valid player ID/name!");
SetPVarInt(target, "Admin", level);
new string[128]; // English
new string2[128]; // Makedonski
pName[MAX_PLAYER_NAME];
gName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
GetPlayerName(target, gName, MAX_PLAYER_NAME);
format(string, sizeof string, "[*] Admin %s has set %s's admin level to %i.", pName, gName, level); // English
format(string2, sizeof string, "[*] Àäìèíèñòðàòîðîò %s ãî íàìåñòè %s's àäìèí ëåâåë íà %i.", pName, gName, level); // Makedonski
SendClientMessageToAdmins(string,string2);
format(string, sizeof string, "[*] Admin %s has set your admin level to %i.", pName, level);
SendClientMessage(target, COLOR_ROYALBLUE, string);
format(string, sizeof string, "%s set %s admin level to: %i", pName, gName, level);
Log("MakeAdmin", string);
return 1;
}


tamo bi hoceo da dodajem nesto vakvo

if ...
{
}
else {
}

kontaate?

pozdrav
Poslednja Izmena: Maj 16, 2011, 17:33:36 POSLE PODNE od Mario Velickovski

Mnogo brze i lakse je da napravis ovaj kod:

if(GetPlayerAdminLevel(playerid) < 4) return SendClientMessage(playerid, COLOR_ORANGE, "[*] You're not a level 4 admin!");

nego ovakav:

if(GetPlayerAdminLevel(playerid) < 4)
{
   SendClientMessage(playerid, COLOR_ORANGE, "[*] You're not a level 4 admin!");
   return 1;
}
Poslednja Izmena: Maj 16, 2011, 17:40:44 POSLE PODNE od eXtreme

Citat: eXtreme poslato Maj 16, 2011, 17:39:29 POSLE PODNE
Mnogo brze i lakse je da napravis ovaj kod:

if(GetPlayerAdminLevel(playerid) < 4) return SendClientMessage(playerid, COLOR_ORANGE, "[*] You're not a level 4 admin!");

nego ovakav:

if(GetPlayerAdminLevel(playerid) < 4)
{
   SendClientMessage(playerid, COLOR_ORANGE, "[*] You're not a level 4 admin!");
   return 1;
}


pa da, zato koristim return ali hocu da ima vise naredbe u return

na primer
if(GetPlayerAdminLevel(playerid) < 4) return
{
if jazik...
{
prati poruku
}
else jazikkk
{
prati poruku
}
jel kontas
}

Pa samo dodas novi uvijet, primjer
if(GetPlayerAdminLevel(playerid) < 4) return SendClientMessage(playerid, COLOR_ORANGE, "[*] You're not a level 4 admin!");
if(!GetPlayerAdminLevel(playerid) < 4) return SendClientMessage(playerid, COLOR_ORANGE, "[*] Bravo, admin si!");


Ako na to mislis...


RESPECT 4 EVER: John, GLC,bAndzi, Nikola, Sop, Zoki, Bruno_Venuti, Mele, Luka P,ExtremePower,Wang(neki kineski frajer)

NAJBOLJI CITATI:
Citat: [GF]Alive poslato Jun 24, 2010, 18:20:19 POSLE PODNE
Paizte ljud mozda je KayLoger! ! !
MOJI RADOVI:
[FS]Trofeji

Citat: LordShigi poslato Maj 16, 2011, 19:37:19 POSLE PODNE
Pa samo dodas novi uvijet, primjer
if(GetPlayerAdminLevel(playerid) < 4) return SendClientMessage(playerid, COLOR_ORANGE, "[*] You're not a level 4 admin!");
if(!GetPlayerAdminLevel(playerid) < 4) return SendClientMessage(playerid, COLOR_ORANGE, "[*] Bravo, admin si!");


Ako na to mislis...

ne, ne nemislim na to,

mislim na ovo

IF USLOV() return { OVDE DA IMA VISE NAREDBE }

pa mozda?!?!??

if(JadaJada()==1)
{
}


RESPECT 4 EVER: John, GLC,bAndzi, Nikola, Sop, Zoki, Bruno_Venuti, Mele, Luka P,ExtremePower,Wang(neki kineski frajer)

NAJBOLJI CITATI:
Citat: [GF]Alive poslato Jun 24, 2010, 18:20:19 POSLE PODNE
Paizte ljud mozda je KayLoger! ! !
MOJI RADOVI:
[FS]Trofeji

recimo da zelis da vratis SendClientMessage i return 0, samo uradis sledece

return SendClientMessage(id,-1,"text") , 0;



Citat: LordShigi poslato Maj 16, 2011, 21:00:26 POSLE PODNE
pa mozda?!?!??

if(JadaJada()==1)
{
}

aha, i ja sam tako mislio ali nisam bio 100% siguran a jel sve funkcionira normalno kao i sa return ?