what happend here?
#7

Before you go, let me explain you in comments what was bad, so you learn something instead of just copy-pasting:

PHP код:
CMD:achat(playeridparams[]) 


  new 
string[128],msg[128],id,name[MAX_PLAYER_NAME];  // Variable id here is useless, why did you make it? You already have playerid.
  
if(pInfo[playerid][Adminlevel] >=|| IsPlayerAdmin(playerid)) // 'IsPlayerAdmin' You were checking here if the player was RCON admin, I highly doubt you provide the server's RCON password to every admin your server have.
  

      if(
sscanf(params"s[128]",msg)) return SCM(playerid,-1,""grey"[SYSTEM]:"red"/achat [Message]"); 
      
GetPlayerName(id,name,sizeof(name)); // again, id did not mean anything here, so we changed it for playerid.
      
format(string,sizeof(string),"[Admins]: %s: %s",pInfo[id][Adminlevel],name,msg); // yor format had two strings but you were trying to add a third one, we removed pInfo[id][Adminlevel] from here as it was not doing anything.
      
foreach(Playeri
      { 
          if(
pInfo[playerid][Adminlevel] >= 1)  // this is inside a loop, the reason you want to loop is to check on every player, hence we changed here player id for 'i'
          

             
SCM(playerid, -1,string);  // same 'i' here
          

      } 
  } 
  else 
  { 
       
SCM(playerid, -1""red"{FF0000}[SYSTEM]: This command available for administrator only."); 
  } 
  return 
1

Everything else was 'ok'. Please keep learning and reading, do not copy-paste!
Reply


Messages In This Thread
what happend here? - by Man43 - 05.03.2017, 19:26
Re: what happend here? - by Toroi - 05.03.2017, 19:35
Re: what happend here? - by Man43 - 05.03.2017, 19:39
Re: what happend here? - by Toroi - 05.03.2017, 19:42
Re: what happend here? - by henkas - 05.03.2017, 19:43
Re: what happend here? - by Man43 - 05.03.2017, 19:46
Re: what happend here? - by Toroi - 05.03.2017, 19:52
Re: what happend here? - by Unte99 - 05.03.2017, 19:58

Forum Jump:


Users browsing this thread: 1 Guest(s)