SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 09/02/2014, 02:48 PM   #21
audriuxxx
Banned
 
Join Date: Jan 2013
Posts: 737
Reputation: 0
Default Re: gCasino - Scripted Casino's

Yes your codes who was in include i left it. But this

#define OnPlayerClickPlayerTextDraw MP_OPCPTD

Is in my gamemode. But can i do that?

Where this code in your include:

Code:
public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid) {
	if (GetPVarInt(playerid, "ss_casino_use") == 1) {
		new _machineID = GetPVarInt(playerid, "ss_casino_using");
		switch (_machines[_machineID][cm_type]) {
			case CASINO_MACHINE_POKER: {
				for (new _b=0; _b<5; _b++) {
					if (playertextid == poker_hold[playerid][_b]) {
						cPoker_button(playerid, CASINO_POKER_BTN_HOLD, _b);
					}
				}
			}
		}
	}

	if (funcidx("_gCasino_OPCPTD") != -1){
		return CallLocalFunction("_gCasino_OPCPTD", "ii", playerid, _:playertextid);
	}
	return 1;
}
Upload this thing to my gamemode like this:

Code:
if (GetPVarInt(playerid, "ss_casino_use") == 1) {
		new _machineID = GetPVarInt(playerid, "ss_casino_using");
		switch (_machines[_machineID][cm_type]) {
			case CASINO_MACHINE_POKER: {
				for (new _b=0; _b<5; _b++) {
					if (playertextid == poker_hold[playerid][_b]) {
						cPoker_button(playerid, CASINO_POKER_BTN_HOLD, _b);
					}
				}
			}
		}
	}
Just a this code, and then delete from your include:

#if defined _ALS_OnPlayerClickPlayerTextDra
#undef OnPlayerClickPlayerTextDraw
#else
#define _ALS_OnPlayerClickPlayerTextDra
#endif

#define OnPlayerClickPlayerTextDraw _gCasino_OPCPTD

forward _gCasino_OPCPTD(playerid, PlayerTextlayertextid);
audriuxxx is offline   Reply With Quote
Old 09/02/2014, 02:58 PM   #22
Grimrandomer
Big Clucker
 
Grimrandomer's Avatar
 
Join Date: Dec 2011
Posts: 131
Reputation: 64
Default Re: gCasino - Scripted Casino's

Ok, I see, your trying to merge it into your game mode. As im new to includes im not quite sure if thats best way to do it, but if anyone else knows im sure they can answer.
__________________
Grimrandomer is offline   Reply With Quote
Old 09/02/2014, 03:30 PM   #23
Pottus
High-roller
 
Pottus's Avatar
 
Join Date: Jun 2012
Posts: 4,885
Reputation: 1351
Default Re: gCasino - Scripted Casino's

If someone is going to use YSI that is going to cause problems I had to hook this callback before YSI is included it looks like this. Keep in mind this was used before YSI was included so you'll probably have to do some preprocessor checks to determine how it should be hooked.

Keep in mind that this is to hook before YSI is included I have not tested it after YSI is included in which case you should use y_hooks for hooking instead.

pawn Code:
public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
{
    OnPlayerClickPlayerTD(playerid, PlayerText:playertextid);
    return 1;
}

#if defined _ALS_OnPlayerClickPlayerTD
    #undef OnPlayerClickPlayerTextDraw
#else
    #define _ALS_OnPlayerClickPlayerTD
#endif
#define OnPlayerClickPlayerTextDraw OnPlayerClickPlayerTD
Pottus is offline   Reply With Quote
Old 09/02/2014, 03:58 PM   #24
audriuxxx
Banned
 
Join Date: Jan 2013
Posts: 737
Reputation: 0
Default Re: gCasino - Scripted Casino's

But can i Just copy that scripts to my callback?
audriuxxx is offline   Reply With Quote
Old 09/02/2014, 09:14 PM   #25
Aerotactics
High-roller
 
Aerotactics's Avatar
 
Join Date: Jun 2013
Location: return 0;
Posts: 1,083
Reputation: 112
Default Re: gCasino - Scripted Casino's

Hey Grim! I'm getting a problem where, when I enter the game, I cant do anything and I get stuck inside it. I specifically dont have enough money for it, so the game must not have a fix for that. Just pointing it out, thanks for the updates, I will keep in touch.
Aerotactics is offline   Reply With Quote
Old 09/02/2014, 09:29 PM   #26
Grimrandomer
Big Clucker
 
Grimrandomer's Avatar
 
Join Date: Dec 2011
Posts: 131
Reputation: 64
Default Re: gCasino - Scripted Casino's

Try pressing Escape to close the menu, that should work.

If you want to script in a command, there are some methods for removing a player from a casino as well as checking if they are in the poker game menu.
__________________
Grimrandomer is offline   Reply With Quote
Old 09/02/2014, 10:05 PM   #27
Aerotactics
High-roller
 
Aerotactics's Avatar
 
Join Date: Jun 2013
Location: return 0;
Posts: 1,083
Reputation: 112
Default Re: gCasino - Scripted Casino's

Quote:
Originally Posted by Grimrandomer View Post
Try pressing Escape to close the menu, that should work.

If you want to script in a command, there are some methods for removing a player from a casino as well as checking if they are in the poker game menu.
I did try pressing escape lol, but was still stuck. Keep improving while you have the time
Aerotactics is offline   Reply With Quote
Old 10/02/2014, 02:40 AM   #28
Kenshin869
Little Clucker
 
Join Date: Jul 2010
Posts: 1
Reputation: 1
Default Re: gCasino - Scripted Casino's

some kind of money known bug? these systems are vulnerable.
Kenshin869 is offline   Reply With Quote
Old 10/02/2014, 09:26 AM   #29
Grimrandomer
Big Clucker
 
Grimrandomer's Avatar
 
Join Date: Dec 2011
Posts: 131
Reputation: 64
Default Re: gCasino - Scripted Casino's

Quote:
Originally Posted by Kenshin869 View Post
some kind of money known bug? these systems are vulnerable.
As this is scripted, it will work with anti-cheat money system, so the winning's cant be hacked etc.
__________________
Grimrandomer is offline   Reply With Quote
Old 10/02/2014, 05:16 PM   #30
audriuxxx
Banned
 
Join Date: Jan 2013
Posts: 737
Reputation: 0
Default Re: gCasino - Scripted Casino's

How to do, if player don't have a money, he can't to bet or win money, just i don't want that player can go to -
audriuxxx is offline   Reply With Quote
Reply

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Include] Scripted Fire Sniperwolves Includes 66 02/05/2017 08:09 AM
Want Something Scripted? andrew4699 Help Archive 1 12/07/2011 01:57 AM
[REQ] [FS] Scripted/un-scripted - AddStaticVehicleEx Jack_Leslie Help Archive 3 08/05/2011 08:16 AM
Scripted Top View Joe Staff Help Archive 20 13/01/2011 01:19 AM
Scripted Smoke playbox12 Help Archive 7 09/05/2010 05:22 PM


All times are GMT. The time now is 01:35 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.