-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathze_givecoin.sma
39 lines (29 loc) · 1008 Bytes
/
ze_givecoin.sma
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <ze_core>
#define ACCESS ADMIN_BAN
public plugin_init ()
{
register_plugin("[ZE] Give Escape Coins", "1.0", "LevHost Gaming")
register_clcmd("ze_giveec", "Cmd_GiveEC", ACCESS, "- ze_giveec <name> <amount>")
}
public Cmd_GiveEC(id)
{
if (!(get_user_flags(id) & ACCESS))
{
client_print(id, print_console, "You have no access to that command")
return PLUGIN_HANDLED
}
new szName[32], szAmount[10]
read_argv (1, szName, charsmax (szName))
read_argv (2, szAmount, charsmax (szAmount))
new iTargetIndex = get_user_index(szName)
if (!iTargetIndex)
{
client_print(id, print_console, "[ZE] Player not found!")
return PLUGIN_HANDLED
}
if (!is_user_connected(iTargetIndex))
return PLUGIN_HANDLED
new iECAmount = str_to_num (szAmount)
ze_set_user_coins(iTargetIndex, ze_get_user_coins(iTargetIndex) + iECAmount)
return PLUGIN_HANDLED
}