[Pomoc] Lideri

Započeo Samp321, Novembar 19, 2012, 09:35:15 PRE PODNE

prethodna tema - sledeća tema

0 članova i 3 gostiju pregledaju ovu temu.

Skripta koju koristim: NBE
Detaljan opis problema: Kada ukucam /lideri meni izbaci u chat ko je tu od lidera kako da napravim kada kucam /lideri da mi izbaci prozorcic i da tu pise
Citat------------[LIDERI-ONLINE]------------
Ime_Prezime - Organizacija
.....
--------------------------[LIDERI]----------------
Ime_Prezime - Organizacija
.....

Tako nesta
Dio skripte: if (strcmp(cmd, "/lideri", true) == 0)
{
        if(IsPlayerConnected(playerid))
    {
SendClientMessage(playerid, COLOR_GRAD1, "|________ Lideri Online ________|");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
    if(PlayerInfo[i][pLeader] == 1)
    {
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "Policija |Lider %s|", sendername);
SendClientMessage(playerid, COLOR_GRAD2, string);
}
                else if(PlayerInfo[i][pLeader] == 2)
    {
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "Interventna |Lider %s|", sendername);
SendClientMessage(playerid, COLOR_GRAD2, string);
}
                else if(PlayerInfo[i][pLeader] == 3)
    {
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "JNA |Lider %s|", sendername);
SendClientMessage(playerid, COLOR_GRAD2, string);
}
                else if(PlayerInfo[i][pLeader] == 4)
    {
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "Bolnicari |Lider %s|", sendername);
SendClientMessage(playerid, COLOR_GRAD2, string);
}
        else if(PlayerInfo[i][pLeader] == 5)
    {
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "Los Surenos |Lider %s|", sendername);
SendClientMessage(playerid, COLOR_GRAD2, string);
}
        else if(PlayerInfo[i][pLeader] == 6)
    {
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "La Familia Sinatra |Lider %s|", sendername);
SendClientMessage(playerid, COLOR_GRAD2, string);
}
                    else if(PlayerInfo[i][pLeader] == 7)
    {
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "Gradonacelnik |Lider %s|", sendername);
SendClientMessage(playerid, COLOR_GRAD2, string);
}
            else if(PlayerInfo[i][pLeader] == 8)
    {
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "Hitman |Lider %s|", sendername);
SendClientMessage(playerid, COLOR_GRAD2, string);
}
            else if(PlayerInfo[i][pLeader] == 9)
    {
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "RTS Novinari |Lider %s|", sendername);
SendClientMessage(playerid, COLOR_GRAD2, string);
}
            else if(PlayerInfo[i][pLeader] == 10)
    {
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "Taxi |Lider %s|", sendername);
SendClientMessage(playerid, COLOR_GRAD2, string);
}
            else if(PlayerInfo[i][pLeader] == 11)
    {
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "GHS |Lider %s|", sendername);
SendClientMessage(playerid, COLOR_GRAD2, string);
}
            else if(PlayerInfo[i][pLeader] == 12)
    {
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "MS13 |Lider %s|", sendername);
SendClientMessage(playerid, COLOR_GRAD2, string);
}
            else if(PlayerInfo[i][pLeader] == 13)
    {
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "Ballas |Lider %s|", sendername);
SendClientMessage(playerid, COLOR_GRAD2, string);
}
            else if(PlayerInfo[i][pLeader] == 14)
    {
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "Yamaguchi |Lider %s|", sendername);
SendClientMessage(playerid, COLOR_GRAD2, string);
}
            else if(PlayerInfo[i][pLeader] == 15)
    {
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "GSF |Lider %s|", sendername);
SendClientMessage(playerid, COLOR_GRAD2, string);
}
                              else if(PlayerInfo[i][pLeader] == 16)
    {
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "Parking Servis |Lider %s|", sendername);
SendClientMessage(playerid, COLOR_GRAD2, string);
}
else if(PlayerInfo[i][pLeader] == 17)
    {
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "Kaznjeni |Lider %s|", sendername);
SendClientMessage(playerid, COLOR_GRAD2, string);
}
            else if(PlayerInfo[i][pLeader] == 18)
    {
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "La Cosa Nostra |Lider %s|", sendername);
SendClientMessage(playerid, COLOR_GRAD2, string);
}
            else if(PlayerInfo[i][pLeader] == 19)
    {
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "OSC TEAM |Lider %s|", sendername);
SendClientMessage(playerid, COLOR_GRAD2, string);
}
else if(PlayerInfo[i][pLeader] == 20)
    {
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "Privatna Organizacija 1 |Lider %s|", sendername);
SendClientMessage(playerid, COLOR_GRAD2, string);
}
else if(PlayerInfo[i][pLeader] == 21)
    {
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "Privatna Organizacija 2 |Lider %s|", sendername);
SendClientMessage(playerid, COLOR_GRAD2, string);
}
else if(PlayerInfo[i][pLeader] == 22)
    {
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "Privatna Organizacija 3 |Lider %s|", sendername);
SendClientMessage(playerid, COLOR_GRAD2, string);
}
else if(PlayerInfo[i][pLeader] == 23)
    {
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "Privatna Organizacija 4 |Lider %s|", sendername);
SendClientMessage(playerid, COLOR_GRAD2, string);
}
else if(PlayerInfo[i][pLeader] == 24)
    {
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "Privatna Organizacija 5 |Lider %s|", sendername);
SendClientMessage(playerid, COLOR_GRAD2, string);
}
}
}
}
return 1;
}

Neke slike/video za lakse dobivanje pomoci(neobavezno):
Poslednja Izmena: Novembar 19, 2012, 09:36:28 PRE PODNE od Samp321

Jednostavno, CMD:lideri(playerid, params[])
{
new string[1024];
format(string, sizeof(string), "");
foreach(Player, i)
{
if (PlayerInfo[i][pLeader] >= 1 || PlayerInfo[i][pLeader] <= 21)
{
new admtext[64];
            new atext[20];
        if(PlayerInfo[i][pLeader] == 1) { admtext = "ORG"; }
        else if(PlayerInfo[i][pLeader] == 2) { admtext = "ORG"; }
    else if(PlayerInfo[i][pLeader] == 3) { admtext = "ORG"; }
    else if(PlayerInfo[i][pLeader] == 4) { admtext = "ORG"; }
    else if(PlayerInfo[i][pLeader] == 5) { admtext = "ORG"; }
else if(PlayerInfo[i][pLeader] == 6) { admtext = "ORG"; }
else if(PlayerInfo[i][pLeader] == 7) { admtext = "ORG"; }
else if(PlayerInfo[i][pLeader] == 8) { admtext = "ORG"; }
else if(PlayerInfo[i][pLeader] == 9) { admtext = "ORG"; }
else if(PlayerInfo[i][pLeader] == 10) { admtext = "ORG"; }
else if(PlayerInfo[i][pLeader] == 12) { admtext = "ORG"; }
else if(PlayerInfo[i][pLeader] == 13) { admtext = "ORG"; }
else if(PlayerInfo[i][pLeader] == 14) { admtext = "ORG"; }
else if(PlayerInfo[i][pLeader] == 15) { admtext = "ORG"; }
else if(PlayerInfo[i][pLeader] == 16) { admtext = "ORG"; }
else if(PlayerInfo[i][pLeader] == 17) { admtext = "ORG"; }
else if(PlayerInfo[i][pLeader] == 18) { admtext = "ORG"; }
else if(PlayerInfo[i][pLeader] == 19) { admtext = "ORG"; }
else if(PlayerInfo[i][pLeader] == 20) { admtext = "ORG"; }
            format(atext, sizeof(atext), "ID:| %d ", i);
strcat(string, atext);
strcat(string, "|");
strcat(string, ImeIgraca(i));
strcat(string, " | ");
            format(admtext, sizeof(admtext), " Lider: {ffffff}%s |", admtext);
strcat(string, admtext);
strcat(string, "\n");
}
}
if(strlen(string) == 0) return SendClientMessage(playerid, TVOJA_BOJA, "SERVER: Nijedan lider nije online!");
ShowPlayerDialog(playerid, 5674, DIALOG_STYLE_MSGBOX, "Lideri na serveru su:", string, "Uredu", "");
return 1;
g}
i dodaj na kraj gma stock ImeIgraca(playerid)
{
new Ime[MAX_PLAYER_NAME];
GetPlayerName(playerid, Ime, sizeof(Ime));
return Ime;
}

Probao sam i sredio sam neke errore i warnige ali dobijem opet nove :P nikako da popravim

nbe.pwn(69048) : error 035: argument type mismatch (argument 2)
nbe.pwn(101573) : warning 219: local variable "Ime" shadows a variable at a preceding level
Pawn compiler 3.2.3664           Copyright (c) 1997-2006, ITB CompuPhase


1 Error.


na 69048:          strcat(stringlideri, ImeIgraca(i));

na 101573:                      new Ime[MAX_PLAYER_NAME];


Tu gde se nalazi 69048 - cela skripta

if (strcmp(cmd, "/lideri", true) == 0)
{
new stringlideri[1024];
format(string, sizeof(string), "");
foreach(Player, i)
{
if (PlayerInfo[i][pLeader] >= 1 || PlayerInfo[i][pLeader] <= 25)
{
new admtext[64];
            new orgtext[50];
            new atext[20];
        if(PlayerInfo[i][pLeader] == 1) { orgtext = "1] Milicija"; }
            else if(PlayerInfo[i][pLeader] == 2) { orgtext = "2] Interventna"; }
            else if(PlayerInfo[i][pLeader] == 3) { orgtext = "3] JNA"; }
            else if(PlayerInfo[i][pLeader] == 4) { orgtext = "4] Bolnicari"; }
            else if(PlayerInfo[i][pLeader] == 5) { orgtext = "5] Los Surenos"; }
            else if(PlayerInfo[i][pLeader] == 6) { orgtext = "6] La Familia Sinatra"; }
            else if(PlayerInfo[i][pLeader] == 7) { orgtext = "7] Vlada"; }
            else if(PlayerInfo[i][pLeader] == 8) { orgtext = "8] Hitman"; }
            else if(PlayerInfo[i][pLeader] == 9) { orgtext = "9] RTS Novinari"; }
            else if(PlayerInfo[i][pLeader] == 10) { orgtext = "10] Taxi"; }
            else if(PlayerInfo[i][pLeader] == 11) { orgtext = "11] GHS"; }
            else if(PlayerInfo[i][pLeader] == 12) { orgtext = "12] MS13"; }
            else if(PlayerInfo[i][pLeader] == 13) { orgtext = "13] Ballas"; }
            else if(PlayerInfo[i][pLeader] == 14) { orgtext = "14] Yamaguchi"; }
            else if(PlayerInfo[i][pLeader] == 15) { orgtext = "15] Groove"; }
            else if(PlayerInfo[i][pLeader] == 16) { orgtext = "16] Parking Servis"; }
            else if(PlayerInfo[i][pLeader] == 18) { orgtext = "19] La Cosa Nostra"; }
            else if(PlayerInfo[i][pLeader] == 19) { orgtext = "20] OSC Team"; }
            else if(PlayerInfo[i][pLeader] == 20) { orgtext = "21] P.O. 1"; }
                else if(PlayerInfo[i][pLeader] == 21) { orgtext = "22] P.O. 2"; }
                    else if(PlayerInfo[i][pLeader] == 22) { orgtext = "23] P.O. 3"; }
                    else if(PlayerInfo[i][pLeader] == 23) { orgtext = "24] P.O. 4"; }
                else if(PlayerInfo[i][pLeader] == 24) { orgtext = "25] P.O. 5"; }
        format(atext, sizeof(atext), "ID:| %d ", i);
strcat(stringlideri, atext);
strcat(stringlideri, "|");
strcat(stringlideri, ImeIgraca(i));
strcat(stringlideri, " | ");
            format(admtext, sizeof(admtext), " Lider: {ffffff}%s |", admtext);
strcat(stringlideri, admtext);
strcat(stringlideri, "\n");
}
}
if(strlen(string) == 0) return SendClientMessage(playerid, COLOR_RED, "Balkan Express 2012: Nijedan lider nije online!");
ShowPlayerDialog(playerid, 5674, DIALOG_STYLE_MSGBOX, "Lideri na serveru su:", string, "Uredu", "");
return 1;
}



Tu gde se nalazi 101573 - cela skripta

stock ImeIgraca(playerid)
{
new Ime[MAX_PLAYER_NAME];
GetPlayerName(playerid, Ime, sizeof(Ime));
return 1;
}

Citat: Adin Tagic poslato Novembar 20, 2012, 18:53:40 POSLE PODNE
neuklapa ti se jer ti je dao cmd iz nl moda :)
Nije iz NL moda :), ON:umesto imeigraca, promeni ime stocka u nesto drugo, i onda i u komandi promeni ImeIgraca u to sto si promenio(xD )