[pomoc] oko komanda

Započeo El Toni, Jun 30, 2011, 17:02:07 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 5 gostiju pregledaju ovu temu.

Skripta koju koristim: GF
Detaljan opis problema: kako da napravim kad nekoj upise /admins da mu dodze koij je level admin pr. Admin 3: Lucky_LUke
Dio skripte: if (strcmp(cmd, "/admins", true) == 0)
{
        if(IsPlayerConnected(playerid))
    {
SendClientMessage(playerid, COLOR_YELLOW, "___*Alpina* - Online Administratori:___");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
    if(PlayerInfo[i][pAdmin] >= 1 && PlayerInfo[i][pAdmin] < 1338)
    {
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "Admin: %s", sendername);
SendClientMessage(playerid, COLOR_GRAD2, string);
}
}
}
}
return 1;
}

Neke slike/video za lakse dobivanje pomoci(neobavezno):




if (strcmp(cmd, "/admins", true) == 0)
{
       if(IsPlayerConnected(playerid))
   {
SendClientMessage(playerid, COLOR_YELLOW, "___*Alpina* - Online Administratori:___");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
   if(PlayerInfo[i][pAdmin] >= 1 && PlayerInfo[i][pAdmin] < 1338)
   {
new admin[64];
                          else if(PlayerInfo[i][pAdmin] == 1338) { admin = "Owner"; }
                     else if(PlayerInfo[i][pAdmin] == 1337) { admin = "1337 Admin"; }
                          else if(PlayerInfo[i][pAdmin] == 4) { admin = "Admin 4 "; }
else if(PlayerInfo[i][pAdmin] == 3) { admin = "Admin 3"; }
else if(PlayerInfo[i][pAdmin] == 2) { admin = "Admin 2"; }
else if(PlayerInfo[i][pAdmin] == 1) { admin = "Admin 1"; }
}
}
}
}
return 1;
}



Umesto ovog Admin 4 ,Admin 3 ,Admin 2 ,Admin 1 ubaci kako ti zelis da ti pise ...;)
Poslednja Izmena: Jun 30, 2011, 17:10:07 POSLE PODNE od [TG]Nxidza

C:\Documents and Settings\Antonio\Desktop\Alpina RPG 0.2v\gamemodes\SAMPMKD.pwn(19857) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Antonio\Desktop\Alpina RPG 0.2v\gamemodes\SAMPMKD.pwn(19857) : warning 215: expression has no effect
C:\Documents and Settings\Antonio\Desktop\Alpina RPG 0.2v\gamemodes\SAMPMKD.pwn(19857) : error 001: expected token: ";", but found "if"


izvadilo mi errore?

Citat: Gigov.so poslato Jun 30, 2011, 17:13:06 POSLE PODNE
C:\Documents and Settings\Antonio\Desktop\Alpina RPG 0.2v\gamemodes\SAMPMKD.pwn(19857) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Antonio\Desktop\Alpina RPG 0.2v\gamemodes\SAMPMKD.pwn(19857) : warning 215: expression has no effect
C:\Documents and Settings\Antonio\Desktop\Alpina RPG 0.2v\gamemodes\SAMPMKD.pwn(19857) : error 001: expected token: ";", but found "if"


izvadilo mi errore?
linija?

Citat: [TG]Nxidza poslato Jun 30, 2011, 17:13:35 POSLE PODNE
Citat: Gigov.so poslato Jun 30, 2011, 17:13:06 POSLE PODNE
C:\Documents and Settings\Antonio\Desktop\Alpina RPG 0.2v\gamemodes\SAMPMKD.pwn(19857) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Antonio\Desktop\Alpina RPG 0.2v\gamemodes\SAMPMKD.pwn(19857) : warning 215: expression has no effect
C:\Documents and Settings\Antonio\Desktop\Alpina RPG 0.2v\gamemodes\SAMPMKD.pwn(19857) : error 001: expected token: ";", but found "if"


izvadilo mi errore?
linija?
else if(PlayerInfo[i][pAdmin] == 1338) { admin = "Owner"; }

if (strcmp(cmd, "/admins", true) == 0)
{
       if(IsPlayerConnected(playerid))
   {
SendClientMessage(playerid, COLOR_YELLOW, "___*Alpina* - Online Administratori:___");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
   if(PlayerInfo[i][pAdmin] >= 1 && PlayerInfo[i][pAdmin] < 1338)
   {
new admin[64];
                         if(PlayerInfo[i][pAdmin] == 1338) { admin = "Owner"; }
                     else if(PlayerInfo[i][pAdmin] == 1337) { admin = "1337 Admin"; }
                          else if(PlayerInfo[i][pAdmin] == 4) { admin = "Admin 4 "; }
else if(PlayerInfo[i][pAdmin] == 3) { admin = "Admin 3"; }
else if(PlayerInfo[i][pAdmin] == 2) { admin = "Admin 2"; }
else if(PlayerInfo[i][pAdmin] == 1) { admin = "Admin 1"; }
}
}
}
}
return 1;
}



tako stavi ...;)

Evo, naj jednostavnije moguce:

if (strcmp(cmd, "/admins", true) == 0)
{
       if(IsPlayerConnected(playerid))
   {
SendClientMessage(playerid, COLOR_YELLOW, "___*Alpina* - Online Administratori:___");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
   if(PlayerInfo[i][pAdmin] >= 1 && PlayerInfo[i][pAdmin] < 1338)
   {
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "Admin: %s | Level: {0CC0FF}%d", sendername, PlayerInfo[i][pAdmin]);
SendClientMessage(playerid, COLOR_GRAD2, string);
}
}
}
}
return 1;
}

Citat: [TG] BloodMaster poslato Jun 30, 2011, 17:20:28 POSLE PODNE
Evo, naj jednostavnije moguce:

if (strcmp(cmd, "/admins", true) == 0)
{
       if(IsPlayerConnected(playerid))
   {
SendClientMessage(playerid, COLOR_YELLOW, "___*Alpina* - Online Administratori:___");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
   if(PlayerInfo[i][pAdmin] >= 1 && PlayerInfo[i][pAdmin] < 1338)
   {
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "Admin: %s | Level: {0CC0FF}%d", sendername, PlayerInfo[i][pAdmin]);
SendClientMessage(playerid, COLOR_GRAD2, string);
}
}
}
}
return 1;
}

Vidis Blood ,toga se uopste nisam setio XD :S