Please help me with this command.. :) - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Please help me with this command.. :) (
/showthread.php?tid=213011)
Please help me with this command.. :) -
trapped1 - 18.01.2011
Please help me.. I need this /giverespect command...
But how to make it for players?
How to make it when player write /giverespect another player see it like Player nick: Gived you a respect point..
Код:
if(strcmp("/giverespect", cmd, true) == 0)
{
if(PlayerInfo[playerid][pAdminLevel] == 3)
{
tmp = strtok(cmdtext,idx);
if(!strlen(tmp))
{
return SendClientMessage(playerid,COLOR_LIGHTRED,"USAGE: /giverespect [id]");
}
new id = strval(tmp);
new pid = playerid;
if(!IsPlayerConnected(id))
{
return SendClientMessage(playerid,COLOR_GRAY,"Player: This player is not online!");
}
if (PlayerInfo[id][pPermissons] < 200)
{
new amsg[100];
new victimid[MAX_PLAYERS];
GetPlayerName(id, victimid, sizeof(victimid));
format(amsg,sizeof(amsg),"Player: You have given %s one respectpoint!",victimid);
SendClientMessage(pid,COLOR_LIGHTBLUE,amsg);
PlayerInfo[id][pPermissons]++;
PlayHintSoundAtPos(playerid);
return 1;
}
else SendClientMessage(pid,COLOR_GRAY,"Player: This player already haves too many respect (over 200)!");
}
else
{
SendClientMessage(playerid,COLOR_GRAY,"You don't have authorization.");
return 1;
}
}
I just searched all forum and ****** and nothing..
(Sorry for my bad English)
Re: Please help me with this command.. :) -
trapped1 - 18.01.2011
Please someone help me I really need this.....
Re: Please help me with this command.. :) -
Johndaonee - 18.01.2011
Just send messages to id and not pid
pawn Код:
SendClientMessage(id,COLOR_LIGHTBLUE,"HELLO MAN");
Re: Please help me with this command.. :) -
trapped1 - 18.01.2011
But a bout function.?
Re: Please help me with this command.. :) -
admantis - 18.01.2011
Thanks for using my code.
pawn Код:
if(strcmp("/giverespect", cmd, true) == 0)
  {
    if(PlayerInfo[playerid][pAdminLevel] == 3)
    {
      tmp = strtok(cmdtext,idx);
      if(!strlen(tmp))
      {
        return SendClientMessage(playerid,COLOR_LIGHTRED,"USAGE: /giverespect [id]");
      }
      new id = strval(tmp);
      new pid = playerid;
      if(!IsPlayerConnected(id))
      {
        return SendClientMessage(playerid,COLOR_GRAY,"Player: This player is not online!");
      }
      if (PlayerInfo[id][pPermissons] < 200)
      {
        new amsg[100];
        new victimid[28];
        new adminid[28];
        GetPlayerName(id, victimid, sizeof(victimid));
        GetPlayerName(pid, adminid, sizeof(adminid));
        format(amsg,sizeof(amsg),"Player: You have given %s one respectpoint!",victimid);
        SendClientMessage(pid,COLOR_LIGHTBLUE,amsg);
        format(amsg,sizeof(amsg),"Player: Admin %s has given you one respectpoint!",adminid);
SendClientMessage(id,COLOR_LIGHTBLUE,amsg);
        PlayerInfo[id][pPermissons]++;
        PlayHintSoundAtPos(playerid);
        return 1;
      }
      else SendClientMessage(pid,COLOR_GRAY,"Player: This player already haves too many respect (over 200)!");
    }
    else
    {
      SendClientMessage(playerid,COLOR_GRAY,"You don't have authorization.");
      return 1;
    }
  }
Edited.
Re: Please help me with this command.. :) -
trapped1 - 18.01.2011
Yeah thanks man for code you helped me a lot just now I'm thinking how I can make it in use...
I'm not pro just I think today it will be done by my self.. so Thanks and have a nice day