Downloading an admin script would give you most of the things.
And the givecash cmd
Код:
public OnPlayerCommandText(playerid,cmdtext[]
{
dcmd(givecash,8,cmdtext);
return 0;
}
dcmd_givecash(playerid,params[])
{
new tmp[256], idx;
tmp = strtok(params,idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, 0xFF3333AA, "Use: /givecash [playerid] [amount]");
return true;
}
new pid = strval(tmp);
if(!IsPlayerConnected(pid))
{
SendClientMessage(playerid, 0xFF3333AA, "Incorrect playerid.");
return true;
}
tmp = strtok(params,idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, 0xFF3333AA, "Use: /givecash [playerid] [amount]");
return true;
}
if(GetPlayerMoney(playerid) < strval(tmp))
{
SendClientMessage(playerid, 0xFF3333AA, "Use: /givecash [playerid] [amount]");
return true;
}
new amount = strval(tmp), string[256], string1[256], pname2[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname2, sizeof(pname2));
if(amount <= 0) return SendClientMessage(playerid, COLOUR_RED, "Invalid amount to send.");
format(string, sizeof(string), "%s sent you $%d", pname2, amount);
format(string1, sizeof(string1), "You sent %s, $%d", pname2, amount);
SendClientMessage(pid,0x33AA33AA, string);
SendClientMessage(playerid,0x33AA33AA, string1);
GivePlayerMoney(pid, amount);
GivePlayerMoney(playerid, -amount);
return true;
}
And the recieve cash when killing
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
new pcash;
pcash = GetPlayerMoney(playerid);
GivePlayerMoney(killerid,pcash);
ResetPlayerMoney(playerid);
return 1;
}