Help me, /ask command
#4

Ask command:
pawn Код:
CMD:ask(playerid,params[])
{
     new string[128],playername[24];
     if(sscanf(params,"s[128]",params)) return SendClientMessage(playerid,0xFFFFFFFF,"USAGE: /ask [question]");
     GetPlayerName(playerid,playername,24);
     format(string,sizeof(string),"%s has requested help, question: %s",playername,params);
     for(new i=0; i<MAX_PLAYERS; i++)
     {
          if(IsPlayerConnected(i))
          {
               if(IsPlayerAdmin(i)) // Or use your admin variable, e.g. if(PlayerInfo[playerid][pAdmin])
               {
                    SendClientMessage(i,0x00FF00FF,string);
               }
           }
      }
      return 1;
}
Reply command:
pawn Код:
CMD:reply(playerid,params[])
{
     new string[128],playername[24],playerb;
     if(!IsPlayerAdmin(playerid)) return 0; //hides the command if they're not an admin
     if(sscanf(params,"us[128]",playerb,params)) return SendClientMessage(playerid,0xFFFFFFFF,"USAGE: /reply [id] [response]");
     if(!IsPlayerConnected(playerb)) return SendClientMessage(playerid,0xFF0000FF,"Invalid player ID!");
     GetPlayerName(playerid,playername,24);
     format(string,sizeof(string),"%s has responded, response: %s",playername,params);
     SendClientMessage(playerb,0x00FF00FF,string);
     GetPlayerName(playerb,playername,24);
     format(string,sizeof(string),"You have replied to %s successfully",playername);
     SendClientMessage(playerid,0x0000FFFF,string);
 
     return 1;
}
Reply


Messages In This Thread
Help me, /ask command - by Goldino - 19.11.2012, 17:04
Re: Help me, /ask command - by park4bmx - 19.11.2012, 17:12
Re: Help me, /ask command - by d0nTtoucH - 23.08.2013, 23:38
Re: Help me, /ask command - by bensmart469 - 24.08.2013, 00:13

Forum Jump:


Users browsing this thread: 1 Guest(s)