hey ,
im using OciXCrom Shop System
im asking if its possible to add "amx_donate , say /donate" commands to the system (to donate points) from non admin player to another player
thank you,
donate points
-
OciXCrom
Извън линия - Администратор
- Мнения: 7206
- Регистриран на: 06 Окт 2016, 19:20
- Местоположение: /resetscore
- Се отблагодари: 117 пъти
- Получена благодарност: 1295 пъти
- Обратна връзка:
-
BloodyPro
Извън линия - Foreigner
- Мнения: 26
- Регистриран на: 26 Юли 2020, 16:28
- Местоположение: Palestine
- Се отблагодари: 1 път
- Обратна връзка:
donate points
ty , its working , is it possible to make it for all players ? not only for the team ur in ?OciXCrom написа: ↑30 Юли 2020, 23:49 I made one here a while ago - https://forums.alliedmods.net/showthrea ... 03&page=22
-
BloodyPro
Извън линия - Foreigner
- Мнения: 26
- Регистриран на: 26 Юли 2020, 16:28
- Местоположение: Palestine
- Се отблагодари: 1 път
- Обратна връзка:
donate points
Код за потвърждение: Избери целия код
#include <amxmodx>
#include <amxmisc>
#include <cromchat>
#include <cstrike>
#include <customshop>
#define PLUGIN "Points Donate"
#define VERSION "1.0"
#define AUTOR "iceeedR"
#if defined client_disconnected
#define client_disconnect client_disconnected
#endif
#if !defined MAX_PLAYERS
const MAX_PLAYERS = 32
#endif
/* Edit by OciXCrom: made the plugin donate points from Custom Shop instead of money */
new const Prefix[] = "[Deathrun Shop]"
new DonateTarget[MAX_PLAYERS +1]
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTOR);
register_clcmd("say /donate", "DonateCmd")
register_clcmd("plugin_donate", "DonateHandler")
}
public client_disconnect(id)
{
DonateTarget[id] = 0 // just for secure
}
public DonateCmd(id)
{
new szItem[64]
formatex(szItem, charsmax(szItem), "\y[\w%s\d - \rDonate Menu \y ]", Prefix)
new iMenu = menu_create(szItem, "donate_handler")
new iPlayers[MAX_PLAYERS], iNum
get_players(iPlayers, iNum, "e", (cs_get_user_team(id) == CS_TEAM_T) ? "TERRORIST" : "CT")
for(new i, szTempid[10], iPlayer;i < iNum;i++)
{
iPlayer = iPlayers[i]
if(iPlayer != id)
{
num_to_str(iPlayer, szTempid, charsmax(szTempid))
get_user_name(iPlayer, szItem, charsmax(szItem))
menu_additem(iMenu, szItem, szTempid)
}
}
menu_display(id, iMenu)
return PLUGIN_HANDLED
}
public donate_handler(id, iMenu, iItem)
{
if(iItem == MENU_EXIT)
{
menu_destroy(iMenu)
return PLUGIN_HANDLED
}
new iData[6], szItemName[MAX_PLAYERS * 2], iAccess, iCallback
menu_item_getinfo(iMenu, iItem, iAccess, iData, charsmax(iData), szItemName, charsmax(szItemName), iCallback)
DonateTarget[id] = str_to_num(iData)
if(!DonateTarget[id])
{
client_print_color(id, print_team_default, "^x04%s%s ^x01This player does not exist.", Prefix)
menu_display(id, iMenu)
DonateTarget[id] = 0
return PLUGIN_HANDLED
}
client_cmd(id, "messagemode plugin_donate")
client_print_color(id, print_team_default, "^x04%s ^x01Type how much you want to give.", Prefix)
return PLUGIN_HANDLED
}
public DonateHandler(id)
{
new szValue[8]
read_argv(1, szValue, charsmax(szValue))
new iValue = str_to_num(szValue)
new iPlayerMoney = cshop_get_points(id)
if( iPlayerMoney < iValue || iValue <= 0)
{
client_print_color(id, print_team_default, "^x04%s ^x01You do not have enough points.", Prefix)
return PLUGIN_CONTINUE
}
cshop_give_points( DonateTarget[id], iValue)
cshop_give_points( id, iValue * -1)
new szNameGiver[MAX_PLAYERS]
get_user_name( id, szNameGiver, charsmax( szNameGiver))
new szNameReceiver[MAX_PLAYERS]
get_user_name(DonateTarget[id], szNameReceiver, charsmax(szNameReceiver))
new iPlayers[MAX_PLAYERS], iNum
get_players(iPlayers, iNum, "e", (cs_get_user_team(id) == CS_TEAM_T) ? "TERRORIST" : "CT")
for(new i;i < iNum;i++)
{
client_print_color(iPlayers[i], print_team_default, "^x04%s^x04 %s^x01 donated^x04 %i points^x01 for^x04 %s.", Prefix, szNameGiver, iValue, szNameReceiver)
}
client_cmd(DonateTarget[id], "spk ^"items/9mmclip1.wav^"")
DonateTarget[id] = 0
return PLUGIN_HANDLED
}
-
OciXCrom
Извън линия - Администратор
- Мнения: 7206
- Регистриран на: 06 Окт 2016, 19:20
- Местоположение: /resetscore
- Се отблагодари: 117 пъти
- Получена благодарност: 1295 пъти
- Обратна връзка:
donate points
Код за потвърждение: Избери целия код
#include <amxmodx>
#include <amxmisc>
#include <cromchat>
#include <customshop>
#define PLUGIN "Points Donate"
#define VERSION "1.0"
#define AUTOR "iceeedR"
#if defined client_disconnected
#define client_disconnect client_disconnected
#endif
#if !defined MAX_PLAYERS
const MAX_PLAYERS = 32
#endif
/* Edit by OciXCrom: made the plugin donate points from Custom Shop instead of money */
new const Prefix[] = "[Deathrun Shop]"
new DonateTarget[MAX_PLAYERS +1]
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTOR);
register_clcmd("say /donate", "DonateCmd")
register_clcmd("plugin_donate", "DonateHandler")
}
public client_disconnect(id)
{
DonateTarget[id] = 0 // just for secure
}
public DonateCmd(id)
{
new szItem[64]
formatex(szItem, charsmax(szItem), "\y[\w%s\d - \rDonate Menu \y ]", Prefix)
new iMenu = menu_create(szItem, "donate_handler")
new iPlayers[MAX_PLAYERS], iNum
get_players(iPlayers, iNum)
for(new i, szTempid[10], iPlayer;i < iNum;i++)
{
iPlayer = iPlayers[i]
if(iPlayer != id)
{
num_to_str(iPlayer, szTempid, charsmax(szTempid))
get_user_name(iPlayer, szItem, charsmax(szItem))
menu_additem(iMenu, szItem, szTempid)
}
}
menu_display(id, iMenu)
return PLUGIN_HANDLED
}
public donate_handler(id, iMenu, iItem)
{
if(iItem == MENU_EXIT)
{
menu_destroy(iMenu)
return PLUGIN_HANDLED
}
new iData[6], szItemName[MAX_PLAYERS * 2], iAccess, iCallback
menu_item_getinfo(iMenu, iItem, iAccess, iData, charsmax(iData), szItemName, charsmax(szItemName), iCallback)
DonateTarget[id] = str_to_num(iData)
if(!DonateTarget[id])
{
client_print_color(id, print_team_default, "^x04%s%s ^x01This player does not exist.", Prefix)
menu_display(id, iMenu)
DonateTarget[id] = 0
return PLUGIN_HANDLED
}
client_cmd(id, "messagemode plugin_donate")
client_print_color(id, print_team_default, "^x04%s ^x01Type how much you want to give.", Prefix)
return PLUGIN_HANDLED
}
public DonateHandler(id)
{
new szValue[8]
read_argv(1, szValue, charsmax(szValue))
new iValue = str_to_num(szValue)
new iPlayerMoney = cshop_get_points(id)
if( iPlayerMoney < iValue || iValue <= 0)
{
client_print_color(id, print_team_default, "^x04%s ^x01You do not have enough points.", Prefix)
return PLUGIN_CONTINUE
}
cshop_give_points( DonateTarget[id], iValue)
cshop_give_points( id, iValue * -1)
new szNameGiver[MAX_PLAYERS]
get_user_name( id, szNameGiver, charsmax( szNameGiver))
new szNameReceiver[MAX_PLAYERS]
get_user_name(DonateTarget[id], szNameReceiver, charsmax(szNameReceiver))
new iPlayers[MAX_PLAYERS], iNum
get_players(iPlayers, iNum)
for(new i;i < iNum;i++)
{
client_print_color(iPlayers[i], print_team_default, "^x04%s^x04 %s^x01 donated^x04 %i points^x01 for^x04 %s.", Prefix, szNameGiver, iValue, szNameReceiver)
}
client_cmd(DonateTarget[id], "spk ^"items/9mmclip1.wav^"")
DonateTarget[id] = 0
return PLUGIN_HANDLED
}
-
- Подобни теми
- Отговори
- Преглеждания
- Последно мнение
-
- 2 Отговори
- 1411 Преглеждания
-
Последно мнение от Infamous2018
-
- 0 Отговори
- 902 Преглеждания
-
Последно мнение от mharisrazaa
-
- 0 Отговори
- 855 Преглеждания
-
Последно мнение от GGzBoy
-
- 1 Отговори
- 756 Преглеждания
-
Последно мнение от Lethality
-
- 2 Отговори
- 1219 Преглеждания
-
Последно мнение от Infamous2018
-
- 3 Отговори
- 2145 Преглеждания
-
Последно мнение от OciXCrom
-
- 3 Отговори
- 1891 Преглеждания
-
Последно мнение от boro2277
Кой е на линия
Потребители разглеждащи този форум: Bing [Bot] и 17 госта