14.06.2015, 16:19
Hi, i have 2 problems in my script first problem:
When i want to see leaders, i've created a dialog for that and it shows all leaders online but the problem is, it only shows one leader, and if there is 2 or more leaders online it will only show 1 leader online and i don't know how to fix it.
Second problem:
So, when i try to put a mask on me it wont change my name label it stays the same, and idk why, here is the code:
When i want to see leaders, i've created a dialog for that and it shows all leaders online but the problem is, it only shows one leader, and if there is 2 or more leaders online it will only show 1 leader online and i don't know how to fix it.
pawn Код:
CMD:lideri(playerid, params[])
{
new string[564];
foreach(Player, i)
{
if(IsPlayerConnected(i))
{
if(PI[i][Lider] == 1) { format(string, sizeof(string), "{FBDF89} (( {00C0FF}Policija: {FFFFFF}%s / {FBDF89}ID:{FFFFFF}%d / {FBDF89}Telefon: {FFFFFF}%d. {FBDF89}))", ImeIgraca(i), i, PI[i][Telefon]); }
else if(PI[i][Lider] == 2) { format(string, sizeof(string), "{FBDF89} (( {0049FF}Federalni Biro: {FFFFFF}%s / {FBDF89}ID:{FFFFFF}%d / {FBDF89}Telefon: {FFFFFF}%d. {FBDF89}))", ImeIgraca(i), i, PI[i][Telefon]); }
else if(PI[i][Lider] == 3) { format(string, sizeof(string), "{FBDF89} (( {FF00EA}Hitna Pomoc: {FFFFFF}%s / {FBDF89}ID:{FFFFFF}%d / {FBDF89}Telefon: {FFFFFF}%d. {FBDF89}))", ImeIgraca(i), i, PI[i][Telefon]); }
else if(PI[i][Lider] == 4) { format(string, sizeof(string), "{FBDF89} (( {C3C3C3}CNN: {FFFFFF}%s / {FBDF89}ID:{FFFFFF}%d / {FBDF89}Telefon: {FFFFFF}%d. {FBDF89}))", ImeIgraca(i), i, PI[i][Telefon]); }
else if(PI[i][Lider] == 5) { format(string, sizeof(string), "{FBDF89} (( {6EF83C}Grove Street: {FFFFFF}%s / {FBDF89}ID:{FFFFFF}%d / {FBDF89}Telefon: {FFFFFF}%d. {FBDF89}))", ImeIgraca(i), i, PI[i][Telefon]); }
else if(PI[i][Lider] == 6) { format(string, sizeof(string), "{FBDF89} (( {B700FF}Ballas: {FFFFFF}%s / {FBDF89}ID:{FFFFFF}%d / {FBDF89}Telefon: {FFFFFF}%d. {FBDF89}))", ImeIgraca(i), i, PI[i][Telefon]); }
else if(PI[i][Lider] == 7) { format(string, sizeof(string), "{FBDF89} (( {FFAF00}Hells Angels: {FFFFFF}%s / {FBDF89}ID:{FFFFFF}%d / {FBDF89}Telefon: {FFFFFF}%d. {FBDF89}))", ImeIgraca(i), i, PI[i][Telefon]); }
else if(PI[i][Lider] == 8) { format(string, sizeof(string), "{FBDF89} (( {F3FF02}Los Surrenos: {FFFFFF}%s / {FBDF89}ID:{FFFFFF}%d / {FBDF89}Telefon: {FFFFFF}%d. {FBDF89}))", ImeIgraca(i), i, PI[i][Telefon]); }
else if(PI[i][Lider] == 9) { format(string, sizeof(string), "{FBDF89} (( {A90202}Yamaguchi: {FFFFFF}%s / {FBDF89}ID:{FFFFFF}%d / {FBDF89}Telefon: {FFFFFF}%d. {FBDF89}))", ImeIgraca(i), i, PI[i][Telefon]); }
else if(PI[i][Lider] == 10) { format(string, sizeof(string), "{FBDF89} (( {FFA1A1}La Familia Sinatra: {FBDF89}{FFFFFF}%s / {FBDF89}ID:{FFFFFF}%d / {FBDF89}Telefon: {FFFFFF}%d. {FBDF89}))", ImeIgraca(i), i, PI[i][Telefon]); }
else if(PI[i][Lider] == 11) { format(string, sizeof(string), "{FBDF89} (( {FF00EA}The Pink Panthers: {FFFFFF}%s / {FBDF89}ID:{FFFFFF}%d / {FBDF89}Telefon: {FFFFFF}%d. ))", ImeIgraca(i), i, PI[i][Telefon]); }
else if(PI[i][Lider] == 12) { format(string, sizeof(string), "{FBDF89} (( {F300FF}Russian Mafia: {FFFFFF}%s / {FBDF89}ID:{FFFFFF}%d / {FBDF89}Telefon: {FFFFFF}%d. {FBDF89}))", ImeIgraca(i), i, PI[i][Telefon]); }
else if(PI[i][Lider] == 13) { format(string, sizeof(string), "{FBDF89} (( {F300FF}Hitman: {FFFFFF}%s / {FBDF89}ID:{FFFFFF}%d / {FBDF89}Telefon: {FFFFFF}%d. {FBDF89}))", ImeIgraca(i), i, PI[i][Telefon]); }
else if(PI[i][Lider] == 13) { format(string, sizeof(string), "{FBDF89} (( {B7FF00}Condor: {FFFFFF}%s / {FBDF89}ID:{FFFFFF}%d / {FBDF89}Telefon: {FFFFFF}%d. {FBDF89}))", ImeIgraca(i), i, PI[i][Telefon]); }
SPD(playerid, 1016, DIALOG_STYLE_MSGBOX, "Online Lideri", string, "Uredu", "");
}
}
return 1;
}
Second problem:
So, when i try to put a mask on me it wont change my name label it stays the same, and idk why, here is the code:
pawn Код:
CMD:maska(playerid, params[])
{
if(AdminDuznost[playerid] == 1 || GMDuznost[playerid] == 1) return SCM(playerid, TOMATO, "[RPF] {FFFFFF}Ne mozete koristiti ovu komandu dok ste na duznosti.");
if(PI[playerid][Maska] == 1)
{
new strn[128], name[24];
GetPlayerName(playerid, name, 24);
if(Maskiran[playerid] == false)
{
SCM(playerid, TOMATO, "[RPF] {FFFFFF}Stavili ste masku na glavu.");
format(strn, sizeof(strn), "(%d)Stranac", playerid);
SetPlayerAttachedObject(playerid, 2 ,19036,2,0.093999,0.026000,-0.004999,93.800018,82.199951,-3.300001,1.098000,1.139999,1.173000);
Maskiran[playerid] = true;
Update3DTextLabelText(Text3D:NameTag[playerid], WHITE, strn);
}
else if(Maskiran[playerid] == true)
{
SCM(playerid, TOMATO, "[RPF] {FFFFFF}Skinuli ste masku sa glave.");
format(strn, sizeof(strn), "%s", name);
Maskiran[playerid] = false;
if(IsPlayerAttachedObjectSlotUsed(playerid, 2)) RemovePlayerAttachedObject(playerid, 2);
Update3DTextLabelText(Text3D:NameTag[playerid], WHITE, strn);
}
}
else return SCM(playerid, TOMATO, "[RPF] {FFFFFF}Nemate masku, morate je kupiti.");
return 1;
}