/rep - command
#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


Messages In This Thread
/rep - command - by kbalor - 28.08.2012, 20:26
Re: /rep - command - by C00K13M0N$73R - 28.08.2012, 20:32
Re: /rep - command - by kbalor - 28.08.2012, 20:41

Forum Jump:


Users browsing this thread: 2 Guest(s)