Pomoc

Započeo Karavdic, April 09, 2022, 15:44:09 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 3 gostiju pregledaju ovu temu.

ne salje text komanda evo kod
CMD:a(playerid, params[])
{
    if(!IsPlayerConnected(playerid)) return SCM(playerid,-1,""CRVENA"(( information ))"BELA" :Moras se ulogovati da bi koristio ovu komandu!");
   if(PlayerInfo[playerid][pAdmin] < 1) return SCM(playerid, -1, ""CRVENA"(( information ))"BELA" : "SIVA"Samo Admini!");
   new text[256], string[512], sendername[MAX_PLAYER_NAME];
   GetPlayerName(playerid, sendername, sizeof(sendername));
   if(sscanf(params, "s[1024]", text)) return SCM(playerid, -1, ""CRVENA"GP:RP Pomoc | "BELA"/a [tekst]");
   new arank[64];
   if(PlayerInfo[playerid][pAdmin] == 1) { arank = "Admin Level 1"; }
   else if(PlayerInfo[playerid][pAdmin] == 2) { arank = "Admin Level 2"; }
   else if(PlayerInfo[playerid][pAdmin] == 3) { arank = "Admin Level 3"; }
   else if(PlayerInfo[playerid][pAdmin] == 4) { arank = "Head Admin"; }
   else if(PlayerInfo[playerid][pAdmin] == 5) { arank = "Direktor"; }
    else if(PlayerInfo[playerid][pSkripter] == 1) { arank = "Skripter"; }
    else if(PlayerInfo[playerid][pSkripter] == 4) { arank = "Mapper"; }
    else if(PlayerInfo[playerid][pVlasnik] == 1) { arank = "Vlasnik"; }
   else if(PlayerInfo[playerid][pAdmin] == 6) { arank = "Vlasnik"; }
   else { arank = "Admin"; }
   format(string, sizeof(string), ""CRVENA"A | "BELA"%s "CRVENA"%s"BELA": %s",arank,sendername,text);
   SendAdminMessage(-1,string);
   return 1;
}

forward&public send admin message
forward SendAdminMessage(color, string[]);
public SendAdminMessage(color, string[])
{
   foreach(Player,i)
   {
      if(PlayerInfo[pAdmin] >= 1)
      {
         SendClientMessage(i, color, string);
      }
   }
}
Poslednja Izmena: Maj 01, 2022, 23:11:00 POSLE PODNE od Deleted User

Formular nista ?
HTML / CSS / Javascript / Inspect : Entry Masterclass.
ReactJS / Tailwind CSS / PWA / Axios / SCSS / Redux, ViteJS : Entry Masterclass.
C / C++ / C# / C-objective - kroz Pawn Lang : Entry Masterclass
Grupisano Pravljenje Objekata : Filterscript.


Sta je to web development?
To je nesto ono kao, kako bih to rekao, izgubis volju za zivotom i zelis da se ubijes, ali to je okej.
Onda jednostavno shvatis da si bio glup i resis problem, das sam sebi lajk,
skuvas NES 3u1 i pripremis se za sledeci projekat.

[pawn]if(PlayerInfo[pAdmin] >= 1)[/pawn]

isto ponovo ne salje poruku



Citat: Karavdic poslato April 09, 2022, 15:44:09 POSLE PODNE
ne salje text komanda evo kod
CMD:a(playerid, params[])
{
    if(!IsPlayerConnected(playerid)) return SCM(playerid,-1,""CRVENA"(( information ))"BELA" :Moras se ulogovati da bi koristio ovu komandu!");
   if(PlayerInfo[playerid][pAdmin] < 1) return SCM(playerid, -1, ""CRVENA"(( information ))"BELA" : "SIVA"Samo Admini!");
   new text[256], string[512], sendername[MAX_PLAYER_NAME];
   GetPlayerName(playerid, sendername, sizeof(sendername));
   if(sscanf(params, "s[1024]", text)) return SCM(playerid, -1, ""CRVENA"GP:RP Pomoc | "BELA"/a [tekst]");
   new arank[64];
   if(PlayerInfo[playerid][pAdmin] == 1) { arank = "Admin Level 1"; }
   else if(PlayerInfo[playerid][pAdmin] == 2) { arank = "Admin Level 2"; }
   else if(PlayerInfo[playerid][pAdmin] == 3) { arank = "Admin Level 3"; }
   else if(PlayerInfo[playerid][pAdmin] == 4) { arank = "Head Admin"; }
   else if(PlayerInfo[playerid][pAdmin] == 5) { arank = "Direktor"; }
    else if(PlayerInfo[playerid][pSkripter] == 1) { arank = "Skripter"; }
    else if(PlayerInfo[playerid][pSkripter] == 4) { arank = "Mapper"; }
    else if(PlayerInfo[playerid][pVlasnik] == 1) { arank = "Vlasnik"; }
   else if(PlayerInfo[playerid][pAdmin] == 6) { arank = "Vlasnik"; }
   else { arank = "Admin"; }
   format(string, sizeof(string), ""CRVENA"A | "BELA"%s "CRVENA"%s"BELA": %s",arank,sendername,text);
   SendAdminMessage(-1,string);
   return 1;
}

forward&public send admin message
forward SendAdminMessage(color, string[]);
public SendAdminMessage(color, string[])
{
   foreach(Player,i)
   {
      if(PlayerInfo[pAdmin] >= 1)
      {
         SendClientMessage(i, color, string);
      }
   }
}
Ubaci na dnu skripte negde
[pawn]
forward SendAdminMessage(color, string[]);
public SendAdminMessage(color, string[])
{
    foreach(new i : Admin) { SendClientMessage(i, color, string); } }
[/pawn]

C:\Users\PC\Desktop\Grawe Project\gamemodes\gp.pwn(1602) : error 017: undefined symbol "Admin@YSII_Ag"
C:\Users\PC\Desktop\Grawe Project\gamemodes\gp.pwn(1602) : error 017: undefined symbol "Admin@YSII_Ag"
C:\Users\PC\Desktop\Grawe Project\gamemodes\gp.pwn(1602) : error 029: invalid expression, assumed zero
C:\Users\PC\Desktop\Grawe Project\gamemodes\gp.pwn(1602) : fatal error 107: too many error messages on one line

[pawn]if(PlayerInfo[pAdmin] >= 1)[/pawn] Ovdje je problem.
Zamjeni sa:
[pawn]if(PlayerInfo[playerid][pAdmin] > 0)[/pawn]

nije ni tu testirao sam mod a i nije playerid nego i.

Citat: Slade poslato April 09, 2022, 19:42:16 POSLE PODNE
[pawn]if(PlayerInfo[pAdmin] >= 1)[/pawn] Ovdje je problem.
Zamjeni sa:
[pawn]if(PlayerInfo[playerid][pAdmin] > 0)[/pawn]
nije [pawn]playerid[/pawn] vec [pawn]i[/pawn]iz razloga sto proveravamo svaki igrac koj je admin a ne samo jedan

Citat: Fergosonn poslato April 09, 2022, 22:46:28 POSLE PODNE
nije [pawn]playerid[/pawn] vec [pawn]i[/pawn]iz razloga sto proveravamo svaki igrac koj je admin a ne samo jedan
Dobro je brate covek je dao primer koriscenja, sta ste toliko zapeli? Valjda je lik sposoban da zameni playerid sa i.

Citat: choppa100 poslato April 09, 2022, 22:53:16 POSLE PODNE
Dobro je brate covek je dao primer koriscenja, sta ste toliko zapeli? Valjda je lik sposoban da zameni playerid sa i.
Nije da objasnjavam Salde-u vec ovom momku
A kod bi  ti radio i ovako
[pawn]CMD:a(playerid, params[])
{
    if(!IsPlayerConnected(playerid)) return SCM(playerid,-1,""CRVENA"(( information ))"BELA" :Moras se ulogovati da bi koristio ovu komandu!");
   if(PlayerInfo[playerid][pAdmin] < 1) return SCM(playerid, -1, ""CRVENA"(( information ))"BELA" : "SIVA"Samo Admini!");
   if(isnull(params))
      return SCM(playerid, -1,""CRVENA"(( information )) {FFFFFF}/a [Text]");
      
   new arank[24];
   switch(PlayerInfo[playerid][pSkripter])
   {
      case 1: arank = "Developer";
      case 4: arank = "Maper";
   }
   switch(PlayerInfo[playerid][pAdmin])
   {
      case 1: arank = "Admin Level 1";
      case 2: arank = "Admin Level 2";
      case 3: arank = "Admin Level 3";
      case 4: arank = "Head Admin";
      case 5: arank = "Direktor";
      case 6: arank = "Vlasnik";
   }
   format(string, sizeof(string), ""CRVENA"A | "BELA"%s "CRVENA"%s"BELA": %s",arank,GetName(playerid),params);
   SendAdminMessage(-1,string);
   return 1;
}

forward SendAdminMessage(color, string[]);
public SendAdminMessage(color, string[])
{
   foreach(Player,i)
   {
      if(PlayerInfo[pAdmin] >= 1)
      {
         SendClientMessage(i, color, string);
      }
   }
}[/pawn]