Reaction test-server side money problem
#1

So i am using this reaction test in my trucking gamemode,it works but when rewarding the player when he does the reaction test,it gives him the money and removes it.How to fix this? TNX who helps in advance.

PHP код:
#include <a_samp>
#define COL_RED            "{F81414}"
#define COL_GREEN          "{6EF83C}"
#define COLOR_ORANGE        0xAA3333AA
#define VRIJEMEP 5 // Number of minutes for how to run the test
#define NAJMANJI_BROJ 2000000 //Must be at least
#define NAJVECI_BROJ 8000000 //The maximum number.
#define NAGRADA_ZA_POBEDNIKA 2500 // You can change the prize
forward NewTest(); //for new test
forward TacanOdgovor(playerid); //for test winner
new BROJ = -1//Minus 1 (-1).
public OnFilterScriptInit()
{
  
SetTimer("NewTest",(1000*60*VRIJEMEP),1); // Timer Minutes
  
return 1;
}
public 
NewTest()
{
  new 
string[128]; //Creating a string to run the numbers and print it.
  
BROJ NAJMANJI_BROJ random(NAJVECI_BROJ-NAJMANJI_BROJ);
/* CorrectNumber: number what he must type
    NAJMANJI_BROJ;NAJVECI_BROJ: The smallest possible number, that number should be typed does not go below
**** 'random' Selects any number between mass and Min values.
    */
  
format(string,sizeof string,"{F81414}New test reaction is started. %d gets $%d.",BROJ,NAGRADA_ZA_POBEDNIKA);
  
SendClientMessageToAll(0xAA3333AA,string); //
}
public 
OnPlayerText(playerid,text[])
{
  if(
strval(text) == BROJ && BROJ != -1// checking is answer correct
  
{
    
TacanOdgovor(playerid);
  }
  return 
1;
}
public 
TacanOdgovor(playerid)
{
  new 
pName[MAX_PLAYER_NAME],string[128];
  
GetPlayerName(playerid,pName,sizeof pName); // Name of winner
  
format(string,sizeof string,"{F81414}Player %s,{F81414}won the test reactions and wins %d! ,",pName,NAGRADA_ZA_POBEDNIKA);
  
SendClientMessageToAll(0xAA3333AA,string);
  
GivePlayerMoney(playerid,NAGRADA_ZA_POBEDNIKA);
  
BROJ = -1;
  return 
1;

Reply
#2

That's because the player money variable is inside your gamemode.
You can easily put that system into your GM.
Reply
#3

You probably need to use your server's money system.
Reply
#4

What?
Reply
#5

Search your gamemode for anything that gives money. If the function that gives money is not "GivePlayerMoney" you are using a custom money system.
Reply
#6

You probably use any anti cheat for money ?
Reply
#7

Thers is no GivePlayerMoney like you sayed
Reply
#8

Quote:

That's because the player money variable is inside your gamemode.
You can easily put that system into your GM.

Just do it....
Reply
#9

Dude ive done what Abagail sayed,the function that gives money is not "GivePlayerMoney".
Reply
#10

Quote:

Dude ive done what Abagail sayed,the function that gives money is not "GivePlayerMoney".

A jebote ubaci taj fs u svoj GM nista lakse
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)