SA-MP Forums Archive
Help. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help. (/showthread.php?tid=380611)



Help. - MrPlatinum - 26.09.2012

Im posting this again because people seen to help once then dont bother to reply at all..

Im trying to install server sided money into my server and im getting these errors, now can someone please give me a solution.

serversidedGM.inc errors
Код HTML:
C:\Users\Brandon\Desktop\SERVER\pawno\include\servermoneyGm.inc(62) : error 004: function "OnPlayerHaveExtraCash" is not implemented
C:\Users\Brandon\Desktop\SERVER\pawno\include\servermoneyGm.inc(96) : warning 201: redefinition of constant/macro (symbol "GetPlayerMoney")
C:\Users\Brandon\Desktop\SERVER\pawno\include\servermoneyGm.inc(97) : warning 201: redefinition of constant/macro (symbol "GivePlayerMoney")
C:\Users\Brandon\Desktop\SERVER\pawno\include\servermoneyGm.inc(98) : warning 201: redefinition of constant/macro (symbol "ResetPlayerMoney")
serversidedGM itself
Код HTML:
/**************************************************
  Name: Server-sided money include for the SA:MP mod
  By: X_Cutter (Yanoй Samson)
  Date: Project started 09/2009, rewritten 09/2010 and fixed 08/2011
  Use: Avoid money hacks/neutraliza money hackers
  Version: 6.0
  SA-MP: All versions should work
 **************************************************
  CREDITS: ****** for the y_hooks/foreach includes

  Use: Add #include <servermoneyGM> right under #include <a_samp> in your gamemode.
  For all the filterscripts you use, add #include <servermoneyFS> to them,
  right below #include <a_samp> as usual.

  You'll have to add public OnPlayerHaveExtraCash(playerid,extramoney) to your gamemode with
  all the other callbacks. This callback will get called WHENEVER a certain player
  acquires at least $100 of hacked money, so, for example a player entering a taxi will
  not get suspected (as I think entering a taxi gives a player $10-$20).

  *NOTE: This script does not support Stunt Bonuses or Casinos or whatever large game-sided money gains!
  *NOTE: Don't forget to add the YSI folder and the foreach include into your include folder!
  Thanks! You should be all set. Report any bug on the SA:MP thread!
 **************************************************/
#include <YSI\y_hooks>
#include <foreach>
#if defined YSI_IS_SERVER
#else
#define YSI_IS_SERVER
#endif
new SERVERSIDETIMER;
new ServerSideCash[MAX_PLAYERS];
Hook:Money_OnGameModeInit()
{
	SERVERSIDETIMER=SetTimer("ServerMoneyCB",1000,true);
	EnableStuntBonusForAll(false);
}
Hook:Money_OnGameModeExit()
{
	KillTimer(SERVERSIDETIMER);
	EnableStuntBonusForAll(true);
}
Hook:Money_OnPlayerDisconnect(playerid,reason)
{
	SetTimerEx("Money_PlayerDisconnected",3000,false,"i",playerid);
}
forward Money_PlayerDisconnected(playerid);
public Money_PlayerDisconnected(playerid)
{
	ServerSideCash[playerid]=0;
	return 1;
}
forward ServerMoneyCB();
public ServerMoneyCB()
{
	foreach(Player,ServerSidep)
	{
		if(GetPlayerMoney(ServerSidep) > ServerSideCash[ServerSidep])
		{
			new H4xc4sh=GetPlayerMoney(ServerSidep);
			H4xc4sh=H4xc4sh-ServerSideCash[ServerSidep];
			if(H4xc4sh > 100) OnPlayerHaveExtraCash(ServerSidep,H4xc4sh);
		}
		if(GetPlayerMoney(ServerSidep) < ServerSideCash[ServerSidep])
		{
			ServerSideCash[ServerSidep]=GetPlayerMoney(ServerSidep);
		}
		GivePlayerMoney(ServerSidep,-GetPlayerMoney(ServerSidep));
		GivePlayerMoney(ServerSidep,ServerSideCash[ServerSidep]);		
	}
	return 1;
}

forward Money_GivePlayerMoney(playerid,cashgiven);
public Money_GivePlayerMoney(playerid,cashgiven)
{
	if(cashgiven<0)
	{
		GivePlayerMoney(playerid,cashgiven);
	}
	ServerSideCash[playerid]=ServerSideCash[playerid]+cashgiven;
	return 1;
}
forward Money_ResetPlayerMoney(playerid);
public Money_ResetPlayerMoney(playerid)
{
	ResetPlayerMoney(playerid);
	ServerSideCash[playerid]=0;
	return 1;
}
forward Money_GetPlayerMoney(playerid);
public Money_GetPlayerMoney(playerid)
{
	return ServerSideCash[playerid];
}
#define GetPlayerMoney Money_GetPlayerMoney
#define GivePlayerMoney Money_GivePlayerMoney
#define ResetPlayerMoney Money_ResetPlayerMoney
// --------------------------------------------------
forward OnPlayerHaveExtraCash(playerid,extramoney);
/*
public OnPlayerHaveExtraCash(playerid,extramoney) // example of usage
{
	new CASHSTR[128];
	format(CASHSTR,128,"No hacking please.(You hacked $%d)",extramoney);
	SendClientMessage(playerid,0xFF0000FF,CASHSTR);
	return 1;
}
*/
This is my Gamemode error
Код HTML:
C:\Users\Brandon\Desktop\SERVER\gamemodes\PPC_Trucking.pwn(81) : error 001: expected token: ";", but found "-identifier-"
And this is line (81)
Код HTML:
// The main function (used only once when the server loads)
main() //Line 81 is here <
{
    new buf[129];
    printf("hash");
    WP_Hash(buf, sizeof (buf), "The quick brown fox jumps over the lazy dog");
    print(buf);
    // Print some standard lines to the server's console
    print("\n----------------------------------");
    print(GameModeName);
    print("----------------------------------\n");
}

I'm happy to give rep to people who help me solve this.


Re: Help. - Glint - 26.09.2012

I am not replying because i don't know how i don't want to receive an infraction for useless posts.

However regarding your problem, there are millions of tutorials on how to create a serverside money system just check the tutorials section.


Re: Help. - ikbenremco - 26.09.2012

Код:
main();
?


Re: Help. - mamorunl - 26.09.2012

Problem 2: Show the line above line 81.


Re: Help. - MrPlatinum - 26.09.2012

Quote:
Originally Posted by mamorunl
Посмотреть сообщение
Problem 2: Show the line above line 81.
Код HTML:
// The main function (used only once when the server loads)



Re: Help. - ikbenremco - 26.09.2012

He ment the coded line not //


Re: Help. - MrPlatinum - 26.09.2012

This is line 74-77

Код HTML:
//forward
forward OnPlayerHaveExtraCash(playerid);
//----------------
native WP_Hash(buffer[], len, const str[])



Re: Help. - mamorunl - 26.09.2012

see, put a semicolon behind 'native WP_Hash()'


Re: Help. - Red_Dragon. - 26.09.2012

Also, you are redefining the same code many, it is already defined