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" |
#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;
}
pawn Код:
|