19.07.2011, 19:25
Like alot of commands i want it so it will be like /givemoney <ID> <Money> Can anyone help me?
dcmd_givemoney(playerid, params[])
{
new id, money;
if (sscanf(params, "ui", id, money)) return SendClientMessage(playerid, -1,"Usage: /givemoney id ammount");
if (id == INVALID_PLAYER_ID) // Send Error Message..
// More stuff
GivePlayerMoney(id, money);
// More stuff
return 1;
}
|
It's even on the wiki, how hard is it to search?
https://sampwiki.blast.hk/wiki/Fast_Commands#givecash |
dcmd_payday(playerid,params[])
{
new
giveplayerid,
amount;
new id,n[MAX_PLAYER_NAME],on[MAX_PLAYER_NAME];
new tmp[256], Index, str[49];
tmp = strtok(params,Index), id = strval(tmp);
GetPlayerName(id,on,sizeof(on));
GetPlayerName(playerid,n,sizeof(n));
if(PInfo[playerid][Level] < 2) return SendClientMessage(playerid,COLOR_RED,"You need to be level 3 Admin to use this command!");
if(!strlen(params)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /payday <ID> <Ammount>");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,COLOR_RED,"Invalid ID");
format(str,sizeof(str),"Admin %s has gave %s money for playing today!",n,on);
SendClientMessageToAll(LIGHTBLUE,str);
GivePlayerMoney(giveplayerid, amount);
GivePlayerMoney(playerid, 0 - amount);
return 1;
}