Raised This Month: $ Target: $400
 0% 

someone can help me??i'am noob..(about native)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
etet
Junior Member
Join Date: Aug 2008
Old 08-28-2008 , 13:55   someone can help me??i'am noob..(about native)
Reply With Quote #1

i wanna to know how can i add native work on this mod and can finish compile.

i don't know this 2 line code~
where i should put in??

Code:
native ryu_get_money(id)
native ryu_set_money(id, iMoney, iFlash)
this is a native~

that all,sorry for my poor english thx very mush: )


Code:
/**
 * teambets.sma
 * Adds team betting. After dying, a player can bet on which team will win.
 * Ported from SM to AMXX by Teyut.
 */
#include <amxmodx>
#include <cstrike>
#pragma semicolon 1
#define PLUGIN_NAME    "Team Bets"
#define PLUGIN_VERSION "1.4"
#define PLUGIN_AUTHOR  "ferret"
#define BET_AMOUNT 0
#define BET_WIN 1
#define BET_TEAM 2
/* TODO: stop using hard-coded max players count and use dynamic array instead. */
#define MAXPLAYERS 32
new g_bEnabled = false;
new g_iPlayerBetData[MAXPLAYERS + 1][3];
new bool:g_bPlayerBet[MAXPLAYERS + 1] = {false, ...};
new bool:g_bOneVsMany = false;
new g_iOneVsManyPot;
new g_iOneVsManyTeam;
new g_hAmxBet;
new g_hAmxBetDeadOnly;
new g_hAmxBetOneVsMany;
new g_hAmxBetAnnounce;
public plugin_init()
{
  register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);
 
  register_dictionary("teambets.txt");
  register_cvar("amx_teambets_version", PLUGIN_VERSION, FCVAR_SERVER|FCVAR_SPONLY); /*TeamBets Version*/
  register_clcmd("say", "Command_Say");
  register_clcmd("say_team", "Command_Say");
  g_hAmxBet = register_cvar("amx_bet", "1"); /*Enable team betting? (0 off, 1 on, def. 1)*/
  g_hAmxBetDeadOnly = register_cvar("amx_bet_deadonly", "1"); /*Only dead players can bet. (0 off, 1 on, def. 1)*/
  g_hAmxBetOneVsMany = register_cvar("amx_bet_onevsmany", "0");  /*The winner of a 1 vs X fight gets the losing pot (def. 0)*/
  g_hAmxBetAnnounce = register_cvar("amx_bet_announce", "0");  /*Announce 1 vs 1 situations (0 off, 1 on, def. 0)*/
  register_event("SendAudio", "Event_RoundEnd", "a", "2=%!MRAD_terwin", "2=%!MRAD_ctwin", "2=%!MRAD_rounddraw");
  register_event("DeathMsg", "Event_PlayerDeath", "a");
  set_task(1.0, "CheckConVar_AmxBet", _, _, _, "b");
  g_bEnabled = true;
  server_print("[itbet] - Loaded");
}
public CheckConVar_AmxBet()
{
  g_bEnabled = (get_pcvar_num(g_hAmxBet) == 1);
}
public Command_Say(client)
{
  if (!g_bEnabled)
    return PLUGIN_CONTINUE;
  new szText[192], iTextLen;
  read_args(szText, sizeof(szText) - 1);
  szText[sizeof(szText) - 1] = 0;
  iTextLen = strlen(szText);
  if(iTextLen < 2)
    return PLUGIN_CONTINUE;
  /* Strips trailling quote */
  szText[iTextLen - 1] = 0;
  new szVerb[16], szTeam[16], szAmount[16];
  parse(szText[1], szVerb, sizeof(szVerb) - 1, szTeam, sizeof(szTeam) - 1, szAmount, sizeof(szAmount) - 1);
  szVerb[sizeof(szVerb) - 1] = 0;
  szTeam[sizeof(szTeam) - 1] = 0;
  szAmount[sizeof(szAmount) - 1] = 0;
  if (strcmp(szVerb, "bet", 1) != 0)
    return PLUGIN_CONTINUE;
  if (g_bPlayerBet[client])
etet is offline
zwfgdlc
Senior Member
Join Date: May 2006
Old 08-29-2008 , 00:05   Re: someone can help me??i'am noob..(about native)
Reply With Quote #2

Code:
/**  * teambets.sma  * Adds team betting. After dying, a player can bet on which team will win.  * Ported from SM to AMXX by Teyut.  */ #include <amxmodx> #include <cstrike> native ryu_get_money(id) native ryu_set_money(id, iMoney, iFlash) #pragma semicolon 1 #define PLUGIN_NAME    "Team Bets" #define PLUGIN_VERSION "1.4" #define PLUGIN_AUTHOR  "ferret" #define BET_AMOUNT 0 #define BET_WIN 1 #define BET_TEAM 2 /* TODO: stop using hard-coded max players count and use dynamic array instead. */ #define MAXPLAYERS 32 new g_bEnabled = false; new g_iPlayerBetData[MAXPLAYERS + 1][3]; new bool:g_bPlayerBet[MAXPLAYERS + 1] = {false, ...}; new bool:g_bOneVsMany = false; new g_iOneVsManyPot; new g_iOneVsManyTeam; new g_hAmxBet; new g_hAmxBetDeadOnly; new g_hAmxBetOneVsMany; new g_hAmxBetAnnounce; public plugin_init() {   register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);     register_dictionary("teambets.txt");   register_cvar("amx_teambets_version", PLUGIN_VERSION, FCVAR_SERVER|FCVAR_SPONLY); /*TeamBets Version*/   register_clcmd("say", "Command_Say");   register_clcmd("say_team", "Command_Say");   g_hAmxBet = register_cvar("amx_bet", "1"); /*Enable team betting? (0 off, 1 on, def. 1)*/   g_hAmxBetDeadOnly = register_cvar("amx_bet_deadonly", "1"); /*Only dead players can bet. (0 off, 1 on, def. 1)*/   g_hAmxBetOneVsMany = register_cvar("amx_bet_onevsmany", "0");  /*The winner of a 1 vs X fight gets the losing pot (def. 0)*/   g_hAmxBetAnnounce = register_cvar("amx_bet_announce", "0");  /*Announce 1 vs 1 situations (0 off, 1 on, def. 0)*/   register_event("SendAudio", "Event_RoundEnd", "a", "2=%!MRAD_terwin", "2=%!MRAD_ctwin", "2=%!MRAD_rounddraw");   register_event("DeathMsg", "Event_PlayerDeath", "a");   set_task(1.0, "CheckConVar_AmxBet", _, _, _, "b");   g_bEnabled = true;   server_print("[itbet] - Loaded"); }
zwfgdlc is offline
Teyut
Junior Member
Join Date: Nov 2006
Location: Somewhere between Mars a
Old 08-29-2008 , 15:04   Re: someone can help me??i'am noob..(about native)
Reply With Quote #3

See the attachments.

You also need to load the "Ryu MoneyX" plugin on your server if you want the native calls to work. I didn't find the source code for that plugin (probably because I can't read Chinese), but if it's not distributed, I wouldn't use it if I where you (there's probably an alternative open source plugin available on the AMXX board).
Attached Files
File Type: sma Get Plugin or Get Source (teambets-ryu.sma - 1006 views - 9.0 KB)
Teyut is offline
zwfgdlc
Senior Member
Join Date: May 2006
Old 08-29-2008 , 15:19   Re: someone can help me??i'am noob..(about native)
Reply With Quote #4

Here is your plugin .
Attached Files
File Type: rar Ryu_MoneyX.rar (63.2 KB, 254 views)
File Type: rar sound.rar (3.1 KB, 245 views)
zwfgdlc is offline
etet
Junior Member
Join Date: Aug 2008
Old 08-30-2008 , 05:59   Re: someone can help me??i'am noob..(about native)
Reply With Quote #5

ok is work,thanks very mush sir!

Last edited by etet; 08-30-2008 at 06:09.
etet is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:09.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode