/report problems... (dcmd)
#1

pawn Код:
dcmd_report(playerid, params[])
    {
      new id, reason, pName[MAX_PLAYER_NAME], idName[MAX_PLAYER_NAME], report[1024];
      if(sscanf(params,"us",id,reason)) return SendClientMessage(playerid,COLOR_DARKRED,"Usage: /report [playerid/partofname] [reason]");
      if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_DARKRED, "Player not found");
      GetPlayerName(playerid,pName,sizeof(pName));
        GetPlayerName(id,idName,sizeof(idName));
        format(report,sizeof(report),"%s[%d] reported %s[%d] Reason: %s",pName,playerid,idName,id,reason);
        SendClientMessage(playerid,COLOR_GREEN,report);
        for(new i; i<MAX_PLAYERS; i++)
        {
            if(PlayerInfo[i][pAdmin] >= 1)
            {
              SendClientMessage(i,COLOR_GREEN,report);
              return 1;
            }
            return 1;
        }
        return 1;
    }
Okey, this one works if you do:

/report [id] [(one single letter]

if you type more then 1 letter on the Reason, It wont work :S

Example:

"/report 0 g" works...
"/report 0 non-rp" doesn't work...

Can someone help pleasE? =)
Reply
#2

Isn't it ANY pro scripter or something who know why?
Reply
#3

Start by resizing report to something like 120, as the chat input is 128 characters max, minus length of "/report ".

Then, look at "reason", it isn't an array and i think you wanted to use "report" instead.
Reply
#4

pawn Код:
dcmd_report(playerid, params[])
    {
      new id, reason, pName[MAX_PLAYER_NAME], idName[MAX_PLAYER_NAME], report[128];
      if(sscanf(params,"us",id,reason)) return SendClientMessage(playerid,COLOR_DARKRED,"Usage: /report [playerid/partofname] [reason]");
      if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_DARKRED, "Player not found");
      GetPlayerName(playerid,pName,sizeof(pName));
        GetPlayerName(id,idName,sizeof(idName));
        format(report,sizeof(report),"%s[%d] reported %s[%d] Reason: %s",pName,playerid,idName,id,reason);
        SendClientMessage(playerid,COLOR_GREEN,report);
        for(new i; i<MAX_PLAYERS; i++)
        {
            if(PlayerInfo[i][pAdmin] >= 1)
            {
              SendClientMessage(i,COLOR_GREEN,report);
            }
        }
        return 1;
    }

try that
Reply
#5

Didn't work...
Reply
#6

pawn Код:
dcmd_report(playerid, params[])
{
  new id, pName[MAX_PLAYER_NAME], idName[MAX_PLAYER_NAME], report[128];
  if(sscanf(params,"us",id,report)) return SendClientMessage(playerid,COLOR_DARKRED,"Usage: /report [playerid/partofname] [reason]");
  if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_DARKRED, "Player not found");
  GetPlayerName(playerid,pName,sizeof(pName));
  GetPlayerName(id,idName,sizeof(idName));
  format(report,sizeof(report),"%s[%d] reported %s[%d] Reason: %s",pName,playerid,idName,id,report);
  SendClientMessage(playerid,COLOR_GREEN,report);
  for(new i; i<MAX_PLAYERS; i++)
    if(PlayerInfo[i][pAdmin] >= 1)
      SendClientMessage(i,COLOR_GREEN,report);
  return 1;
}
Reply
#7

Quote:
Originally Posted by Nubotron
pawn Код:
dcmd_report(playerid, params[])
{
  new id, pName[MAX_PLAYER_NAME], idName[MAX_PLAYER_NAME], report[128];
  if(sscanf(params,"us",id,report)) return SendClientMessage(playerid,COLOR_DARKRED,"Usage: /report [playerid/partofname] [reason]");
  if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_DARKRED, "Player not found");
  GetPlayerName(playerid,pName,sizeof(pName));
  GetPlayerName(id,idName,sizeof(idName));
  format(report,sizeof(report),"%s[%d] reported %s[%d] Reason: %s",pName,playerid,idName,id,report);
  SendClientMessage(playerid,COLOR_GREEN,report);
  for(new i; i<MAX_PLAYERS; i++)
    if(PlayerInfo[i][pAdmin] >= 1)
      SendClientMessage(i,COLOR_GREEN,report);
  return 1;
}
THX Very much man lova ya :P <3
Reply
#8

queer
Reply
#9

Quote:
Originally Posted by 2pacalypse
queer
Nice to see you back , haven't seen you in a while.
Reply
#10

lmao, that's joke btw no one flip the script (pun intended) and yea, I've been away a while with basketball and hockey and such, but I'm scripting a new GM, gettin' active again, will be good xD
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)