[POMOC] Trebam pomoc oko komande /listasvihlidera

Započeo 𝓒𝓪𝓼𝓮𝔂, Jul 02, 2013, 19:58:00 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 4 gostiju pregledaju ovu temu.

Skripta koju koristim: moja editovana
Detaljan opis problema: dole opsirnije
Dio skripte: nie potrebno
Neke slike/video za lakse dobivanje pomoci(neobavezno):  netreba

Eh ovako pokusao sam sve zive kombinacije ( bar se ja nadam ) :D da napravim komandu lista svih lidera
i kad se kuca komanda da mi otvori i pokaze [ ONLINE ] i f offline ] tako da mi printa tko je online i offline
Heaven Community [IN PROGRESS]

Citat: [EM] Casey poslato Jul 02, 2013, 19:58:00 POSLE PODNE
Skripta koju koristim: moja editovana
Detaljan opis problema: dole opsirnije
Dio skripte: nie potrebno
Neke slike/video za lakse dobivanje pomoci(neobavezno):  netreba

Eh ovako pokusao sam sve zive kombinacije ( bar se ja nadam ) :D da napravim komandu lista svih lidera
i kad se kuca komanda da mi otvori i pokaze [ ONLINE ] i f offline ] tako da mi printa tko je online i offline


napravis da kad das lidera da ga zapamti u jednom fajlu, i onda ga iz tog fajla iscitavas, to je jedna kombinacija koja sigurno radi
Other Dimension RolePlay | Uskoro
Ukoliko zelite pomoci u razvoju servera, mozete se meni javit na PP/PM!

Citat: Crazyn3ss poslato Jul 02, 2013, 20:06:04 POSLE PODNE
Citat: [EM] Casey poslato Jul 02, 2013, 19:58:00 POSLE PODNE
Skripta koju koristim: moja editovana
Detaljan opis problema: dole opsirnije
Dio skripte: nie potrebno
Neke slike/video za lakse dobivanje pomoci(neobavezno):  netreba

Eh ovako pokusao sam sve zive kombinacije ( bar se ja nadam ) :D da napravim komandu lista svih lidera
i kad se kuca komanda da mi otvori i pokaze [ ONLINE ] i f offline ] tako da mi printa tko je online i offline


napravis da kad das lidera da ga zapamti u jednom fajlu, i onda ga iz tog fajla iscitavas, to je jedna kombinacija koja sigurno radi

e jel ti moeni to malo vise mozes objasnit crazy ja sam pocetnik ja nezz kako da mi save i cita :D znam samo da treba napraviti mapu u scriptfiles probao sam svasta oko toga
Heaven Community [IN PROGRESS]

u komandu gdje dajes lidera stavis ovako


         new var[64];
    new File:hFile = fopen("lideri/leaders.txt", io_append);
    format(var,48,"%s\r\n",giveplayer);
    fwrite(hFile, var);
    fclose(hFile);



i komanda npr


if(strcmp(cmd, "/listasvihlidera", true) == 0)
{
  new string[128],text[32],text1[8],gFile[35];
  new File:file = fopen("lideri/leaders.txt", io_read);
  while(fread(file, text)) {
format(string,128,"%s",text);
if(GetPlayerID(text) == -1) {text1 = "Offline";}
else {text1 = "Online";}
format(string,128,"%s [%s]",text,text1);
SCM(playerid,-1,string);}
            fclose(file);
return 1;
}


ovo stavi na kraj mod
stock GetPlayerID(const Namep[])
{
    for(new i; i<MAX_PLAYERS; i++)
    {
      if(IsPlayerConnected(i))
      {
        new pName[MAX_PLAYER_NAME];
        GetPlayerName(i, pName, sizeof(pName));
        if(strcmp(Namep, pName, true)==0)
        {
          return i;
        }
      }
    }
    return -1;
}
Other Dimension RolePlay | Uskoro
Ukoliko zelite pomoci u razvoju servera, mozete se meni javit na PP/PM!

Citat: Crazyn3ss poslato Jul 02, 2013, 21:45:01 POSLE PODNE
u komandu gdje dajes lidera stavis ovako


         new var[64];
    new File:hFile = fopen("lideri/leaders.txt", io_append);
    format(var,48,"%s\r\n",giveplayer);
    fwrite(hFile, var);
    fclose(hFile);



i komanda npr


if(strcmp(cmd, "/listasvihlidera", true) == 0)
{
  new string[128],text[32],text1[8],gFile[35];
  new File:file = fopen("lideri/leaders.txt", io_read);
  while(fread(file, text)) {
format(string,128,"%s",text);
if(GetPlayerID(text) == -1) {text1 = "Offline";}
else {text1 = "Online";}
format(string,128,"%s [%s]",text,text1);
SCM(playerid,-1,string);}
            fclose(file);
return 1;
}


ovo stavi na kraj mod
stock GetPlayerID(const Namep[])
{
    for(new i; i<MAX_PLAYERS; i++)
    {
      if(IsPlayerConnected(i))
      {
        new pName[MAX_PLAYER_NAME];
        GetPlayerName(i, pName, sizeof(pName));
        if(strcmp(Namep, pName, true)==0)
        {
          return i;
        }
      }
    }
    return -1;
}




C:\Documents and Settings\BEN\Desktop\EM.pwn(53374) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Documents and Settings\BEN\Desktop\EM.pwn(53378) : error 035: argument type mismatch (argument 1)
C:\Documents and Settings\BEN\Desktop\EM.pwn(53374) : warning 204: symbol is assigned a value that is never used: "gFile"
Pawn compiler 3.2.3664           Copyright (c) 1997-2006, ITB CompuPhase


1 Error.


ja znam da nisam uspio uklopiti s komanom makeleader :D
evo ti komanda



if(strcmp(cmd, "/makeleader", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "{0F629F}Koriscenje: {FFFFFF}/makeleader [ID Igraca/Dio Imena] [Broj(1-23)]");
return 1;
}
            new var[64];
        new File:hFile = fopen("lideri/leaders.txt", io_append);
        format(var,48,"%s\r\n",giveplayer);
        fwrite(hFile, var);
        fclose(hFile);
            new para1;
new level;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
level = strval(tmp);
if(level > 23 || level < 0) { SendClientMessage(playerid, COLOR_GREY, "{0F629F}[GRESKA] {FFFFFF}Nemojte ispod 0, ili preko 23!"); return 1; }
if (PlayerInfo[playerid][pAdmin] >= 1339)
{
    if(IsPlayerConnected(para1))
    {
        if(para1 != INVALID_PLAYER_ID)
        {
            if(PlayerInfo[para1][pMember] > 0 || PlayerInfo[para1][pFMember] < 255)
            {
                SendClientMessage(playerid, COLOR_GREY, "[GRESKA] Taj igrac je clan neke organizacije !");
                return 1;
            }
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[para1][pLeader] = level;
format(string, sizeof(string), "Admin %s vam je dao Lidera Organizacije ID %d.", sendername,level);
SendClientMessage(para1, COLOR_LIGHTRED, string);
format(string, sizeof(string), "Postavili ste %s-a za Lidera Organizacije ID %d.", giveplayer,level);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
if(level == 0) { PlayerInfo[para1][pChar] = 0; PlayerInfo[para1][pRank] = 0; gTeam[para1] = 3; PlayerInfo[para1][pTeam] = 0; return 1; }
else if(level == 1) { PlayerInfo[para1][pChar] = 283; PlayerInfo[para1][pModel] = 283; }//LS PD
else if(level == 2) { PlayerInfo[para1][pChar] = 165; PlayerInfo[para1][pModel] = 165; } //BIA/ATF
else if(level == 4) { PlayerInfo[para1][pChar] = 147; PlayerInfo[para1][pModel] = 147; } //Fire/Ambulance
else if(level == 5) { PlayerInfo[para1][pChar] = 272; PlayerInfo[para1][pModel] = 272; } //Ruska Mafija
else if(level == 6) { PlayerInfo[para1][pChar] = 292; PlayerInfo[para1][pModel] = 292; } //TEC
else if(level == 7) { PlayerInfo[para1][pChar] = 120; PlayerInfo[para1][pModel] = 120; } //Mayor
else if(level == 9) { PlayerInfo[para1][pChar] = 228; PlayerInfo[para1][pModel] = 228; } //News Reporters
else if(level == 10) { PlayerInfo[para1][pChar] = 258; PlayerInfo[para1][pModel] = 258; } //Taxi Cab Company
else if(level == 12) { PlayerInfo[para1][pChar] = 16; PlayerInfo[para1][pModel] = 16; } //Parking Servis
else if(level == 15) { PlayerInfo[para1][pChar] = 110; PlayerInfo[para1][pModel] = 110; } //vagos
else if(level == 16) { PlayerInfo[para1][pChar] = 271; PlayerInfo[para1][pModel] = 271; } //grove
else if(level == 20) { PlayerInfo[para1][pChar] = 186; PlayerInfo[para1][pModel] = 186; } //yakuza
else if(level == 23) { PlayerInfo[para1][pChar] = 120; PlayerInfo[para1][pModel] = 120; } //LCN
                        if(level == 0)
{
    gTeam[para1] = 3;
    PlayerInfo[para1][pTeam] = 3;
}
else if(level == 1 || level == 2 || level == 3)
{
    gTeam[para1] = 2;
    PlayerInfo[para1][pTeam] = 2;
}
else if(level == 4)
{
    gTeam[para1] = 1;
    PlayerInfo[para1][pTeam] = 1;
}
else
{
    gTeam[para1] = 15;
    PlayerInfo[para1][pTeam] = 15;
}

    SetPlayerSkin(para1, PlayerInfo[para1][pChar]);

    if(level == 0)
    {
        PlayerInfo[para1][pRank] = 0;
    }
    else
    {
    PlayerInfo[para1][pRank] = 6;
}
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "   Niste ovlasteni da koristite tu komandu!");
}
}
return 1;
}

Heaven Community [IN PROGRESS]

if(strcmp(cmd, "/makeleader", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "{0F629F}Koriscenje: {FFFFFF}/makeleader [ID Igraca/Dio Imena] [Broj(1-23)]");
return 1;
}
new level;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
level = strval(tmp);
if(level > 23 || level < 0) { SendClientMessage(playerid, COLOR_GREY, "{0F629F}[GRESKA] {FFFFFF}Nemojte ispod 0, ili preko 23!"); return 1; }
if (PlayerInfo[playerid][pAdmin] >= 1339)
{
    if(IsPlayerConnected(para1))
    {
        if(para1 != INVALID_PLAYER_ID)
        {
            if(PlayerInfo[para1][pMember] > 0 || PlayerInfo[para1][pFMember] < 255)
            {
                SendClientMessage(playerid, COLOR_GREY, "[GRESKA] Taj igrac je clan neke organizacije !");
                return 1;
            }
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[para1][pLeader] = level;
format(string, sizeof(string), "Admin %s vam je dao Lidera Organizacije ID %d.", sendername,level);
new var[64];
        new File:hFile = fopen("lideri/leaders.txt", io_append);
        format(var,48,"%s\r\n",giveplayer);
        fwrite(hFile, var);
        fclose(hFile);
            new para1;
SendClientMessage(para1, COLOR_LIGHTRED, string);
format(string, sizeof(string), "Postavili ste %s-a za Lidera Organizacije ID %d.", giveplayer,level);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
if(level == 0) { PlayerInfo[para1][pChar] = 0; PlayerInfo[para1][pRank] = 0; gTeam[para1] = 3; PlayerInfo[para1][pTeam] = 0; return 1; }
else if(level == 1) { PlayerInfo[para1][pChar] = 283; PlayerInfo[para1][pModel] = 283; }//LS PD
else if(level == 2) { PlayerInfo[para1][pChar] = 165; PlayerInfo[para1][pModel] = 165; } //BIA/ATF
else if(level == 4) { PlayerInfo[para1][pChar] = 147; PlayerInfo[para1][pModel] = 147; } //Fire/Ambulance
else if(level == 5) { PlayerInfo[para1][pChar] = 272; PlayerInfo[para1][pModel] = 272; } //Ruska Mafija
else if(level == 6) { PlayerInfo[para1][pChar] = 292; PlayerInfo[para1][pModel] = 292; } //TEC
else if(level == 7) { PlayerInfo[para1][pChar] = 120; PlayerInfo[para1][pModel] = 120; } //Mayor
else if(level == 9) { PlayerInfo[para1][pChar] = 228; PlayerInfo[para1][pModel] = 228; } //News Reporters
else if(level == 10) { PlayerInfo[para1][pChar] = 258; PlayerInfo[para1][pModel] = 258; } //Taxi Cab Company
else if(level == 12) { PlayerInfo[para1][pChar] = 16; PlayerInfo[para1][pModel] = 16; } //Parking Servis
else if(level == 15) { PlayerInfo[para1][pChar] = 110; PlayerInfo[para1][pModel] = 110; } //vagos
else if(level == 16) { PlayerInfo[para1][pChar] = 271; PlayerInfo[para1][pModel] = 271; } //grove
else if(level == 20) { PlayerInfo[para1][pChar] = 186; PlayerInfo[para1][pModel] = 186; } //yakuza
else if(level == 23) { PlayerInfo[para1][pChar] = 120; PlayerInfo[para1][pModel] = 120; } //LCN
                        if(level == 0)
{
    gTeam[para1] = 3;
    PlayerInfo[para1][pTeam] = 3;
}
else if(level == 1 || level == 2 || level == 3)
{
    gTeam[para1] = 2;
    PlayerInfo[para1][pTeam] = 2;
}
else if(level == 4)
{
    gTeam[para1] = 1;
    PlayerInfo[para1][pTeam] = 1;
}
else
{
    gTeam[para1] = 15;
    PlayerInfo[para1][pTeam] = 15;
}

    SetPlayerSkin(para1, PlayerInfo[para1][pChar]);

    if(level == 0)
    {
        PlayerInfo[para1][pRank] = 0;
    }
    else
    {
    PlayerInfo[para1][pRank] = 6;
}
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "   Niste ovlasteni da koristite tu komandu!");
}
}
return 1;
}

Citat: Sany Boy poslato Jul 03, 2013, 09:19:30 PRE PODNE
if(strcmp(cmd, "/makeleader", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "{0F629F}Koriscenje: {FFFFFF}/makeleader [ID Igraca/Dio Imena] [Broj(1-23)]");
return 1;
}
new level;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
level = strval(tmp);
if(level > 23 || level < 0) { SendClientMessage(playerid, COLOR_GREY, "{0F629F}[GRESKA] {FFFFFF}Nemojte ispod 0, ili preko 23!"); return 1; }
if (PlayerInfo[playerid][pAdmin] >= 1339)
{
    if(IsPlayerConnected(para1))
    {
        if(para1 != INVALID_PLAYER_ID)
        {
            if(PlayerInfo[para1][pMember] > 0 || PlayerInfo[para1][pFMember] < 255)
            {
                SendClientMessage(playerid, COLOR_GREY, "[GRESKA] Taj igrac je clan neke organizacije !");
                return 1;
            }
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[para1][pLeader] = level;
format(string, sizeof(string), "Admin %s vam je dao Lidera Organizacije ID %d.", sendername,level);
new var[64];
        new File:hFile = fopen("lideri/leaders.txt", io_append);
        format(var,48,"%s\r\n",giveplayer);
        fwrite(hFile, var);
        fclose(hFile);
            new para1;
SendClientMessage(para1, COLOR_LIGHTRED, string);
format(string, sizeof(string), "Postavili ste %s-a za Lidera Organizacije ID %d.", giveplayer,level);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
if(level == 0) { PlayerInfo[para1][pChar] = 0; PlayerInfo[para1][pRank] = 0; gTeam[para1] = 3; PlayerInfo[para1][pTeam] = 0; return 1; }
else if(level == 1) { PlayerInfo[para1][pChar] = 283; PlayerInfo[para1][pModel] = 283; }//LS PD
else if(level == 2) { PlayerInfo[para1][pChar] = 165; PlayerInfo[para1][pModel] = 165; } //BIA/ATF
else if(level == 4) { PlayerInfo[para1][pChar] = 147; PlayerInfo[para1][pModel] = 147; } //Fire/Ambulance
else if(level == 5) { PlayerInfo[para1][pChar] = 272; PlayerInfo[para1][pModel] = 272; } //Ruska Mafija
else if(level == 6) { PlayerInfo[para1][pChar] = 292; PlayerInfo[para1][pModel] = 292; } //TEC
else if(level == 7) { PlayerInfo[para1][pChar] = 120; PlayerInfo[para1][pModel] = 120; } //Mayor
else if(level == 9) { PlayerInfo[para1][pChar] = 228; PlayerInfo[para1][pModel] = 228; } //News Reporters
else if(level == 10) { PlayerInfo[para1][pChar] = 258; PlayerInfo[para1][pModel] = 258; } //Taxi Cab Company
else if(level == 12) { PlayerInfo[para1][pChar] = 16; PlayerInfo[para1][pModel] = 16; } //Parking Servis
else if(level == 15) { PlayerInfo[para1][pChar] = 110; PlayerInfo[para1][pModel] = 110; } //vagos
else if(level == 16) { PlayerInfo[para1][pChar] = 271; PlayerInfo[para1][pModel] = 271; } //grove
else if(level == 20) { PlayerInfo[para1][pChar] = 186; PlayerInfo[para1][pModel] = 186; } //yakuza
else if(level == 23) { PlayerInfo[para1][pChar] = 120; PlayerInfo[para1][pModel] = 120; } //LCN
                        if(level == 0)
{
    gTeam[para1] = 3;
    PlayerInfo[para1][pTeam] = 3;
}
else if(level == 1 || level == 2 || level == 3)
{
    gTeam[para1] = 2;
    PlayerInfo[para1][pTeam] = 2;
}
else if(level == 4)
{
    gTeam[para1] = 1;
    PlayerInfo[para1][pTeam] = 1;
}
else
{
    gTeam[para1] = 15;
    PlayerInfo[para1][pTeam] = 15;
}

    SetPlayerSkin(para1, PlayerInfo[para1][pChar]);

    if(level == 0)
    {
        PlayerInfo[para1][pRank] = 0;
    }
    else
    {
    PlayerInfo[para1][pRank] = 6;
}
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "   Niste ovlasteni da koristite tu komandu!");
}
}
return 1;
}



oh hvala vam decki mnoog ste mi pomogli :D hvala Crazy hvala sany :D Respect od mene
Heaven Community [IN PROGRESS]