/rep - command
#1

You guys know reputation command? It's just like giving cash or cookies. But it has limits. Also they could only use /rep command once every one hour. Why? So they won't abuse it.
The maximum reputation could be given to a single player is 2 or +2, So basically +1 and the highest is +2.

Let's say..

Quote:

I do /rep [PlayerID] [Reputation]

/rep 4 2

SendClientMessage(playerid, gay, "You have given Coconut (ID:4) a Reputation of +2);

on the receiver ("Burloloy (ID:3) has give you a Reputation of +2. Send back reputation by.... so on")

EDIT: If player tried to use /rep command but he did not wait 1 hour "You must for 1 hour to use Reputation again"

Reply
#2

pawn Код:
#include <a_samp>
#include <sscanf2>
#include <zcmd>

new pRep[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    pRep[playerid] = 0;
    return 1;
}

CMD:rep(playerid,params[])
{
    new rep,target,pName[MAX_PLAYER_NAME],string1[124],string[124],pTarget[MAX_PLAYER_NAME];
    if(sscanf(params,"ui",target,rep)) return SendClientMessage(playerid,-1,"/rep [playerid] [reputation]");
    new oldrep = pRep[target];
    pRep[target] = oldrep+rep;
    GetPlayerName(target,pTarget,MAX_PLAYER_NAME);
    format(string,sizeof(string),"You gave %s(ID:%d) +%d reputation!",pTarget,target,rep);
    SendClientMessage(playerid,-1,string);
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string1,sizeof(string1),"%s,(ID:%d) has gave you +%d reputation.",pName,playerid,rep);
    SendClientMessage(target,-1,string1);
    return 1;
}
Reply
#3

Quote:
Originally Posted by C00K13M0N$73R
Посмотреть сообщение
pawn Код:
#include <a_samp>
#include <sscanf2>
#include <zcmd>

new pRep[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    pRep[playerid] = 0;
    return 1;
}

CMD:rep(playerid,params[])
{
    new rep,target,pName[MAX_PLAYER_NAME],string1[124],string[124],pTarget[MAX_PLAYER_NAME];
    if(sscanf(params,"ui",target,rep)) return SendClientMessage(playerid,-1,"/rep [playerid] [reputation]");
    new oldrep = pRep[target];
    pRep[target] = oldrep+rep;
    GetPlayerName(target,pTarget,MAX_PLAYER_NAME);
    format(string,sizeof(string),"You gave %s(ID:%d) +%d reputation!",pTarget,target,rep);
    SendClientMessage(playerid,-1,string);
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string1,sizeof(string1),"%s,(ID:%d) has gave you +%d reputation.",pName,playerid,rep);
    SendClientMessage(target,-1,string1);
    return 1;
}
Thank man it needs lot of edit Also I could rep myself.. To wait 1 hour again it must have a timer right? I'm not sure.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)