Please help me with this command.. :)
#1

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)
Reply
#2

Please someone help me I really need this.....
Reply
#3

Just send messages to id and not pid
pawn Код:
SendClientMessage(id,COLOR_LIGHTBLUE,"HELLO MAN");
Reply
#4

But a bout function.?
Reply
#5

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.
Reply
#6

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
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)