Code:
#include <a_samp>
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
native sscanf(const data[], const format[], {Float,_}:...);
new hitman[MAX_PLAYERS];
new miktar;
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(hitman, 15, cmdtext);
return 0;
}
dcmd_hitman(playerid, params[])
{
new id, str[128];
if(sscanf(params, "ii", id, miktar)) return SendClientMessage(playerid, -1, "KULLANIM: /hitman [id] [miktar]");
format(str, sizeof(str), "%d$", miktar);
new Text3D:label = Create3DTextLabel(str, 0x008080FF, 100.0, 100.0, 100.0, 100.0, 0);
Attach3DTextLabelToPlayer(label, id, 0.0, 0.0, 0.7);
hitman[id] = 1;
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
if(hitman[playerid] == 1)
{
GivePlayerMoney(killerid, miktar);
}
return 1;
}