CreateCasinoMachine(_type, Float:_lX, Float:_lY, Float:_lZ, Float:_rX, Float:_rY, Float:_rZ, useDynamicObj=0);
// _type is the Casino Type (Currently only CASINO_MACHINE_POKER)
// _lX, _lY, _lZ is the Position X/Y/Z
// _rX, _rY, _rZ is the Rotation X/Y/Z
// useDynamicObj=0 is to use the DynamicObject in incognito's streamer (Requires the <streamer> be included prior to <GrimCasino> )
//Returns: _machineID
RemoveCasinoMachine(_machineID); //Safely destroy a casino object
IsValidCasinoMachineType(_type); //Is this casino type valid?
GetMachineType(_machineID, &_type); //Gets the casino machine type (Returns 0 if its an invalid machine id)
ClosestCasinoMachine(playerid); //Machine ID they are near (INVALID_CASINO_MACHINE_ID if by none)
IsPlayerAtAnyCasinoMachine(playerid); //Is player currently using any machine
IsPlayerAtCasinoMachine(playerid, _machineID); //is player currently using a machine
RemoveAllFromMachine(_machineID); //Remove all players using a machine
RemoveFromMachine(playerid, _machineID); //Remove a player from a machine
RemoveAllFromAllMachines(); //Kick all players from all machines
forward OnCasinoMoney(playerid, machineid, amount, result); //Casino Money Event
//result = CASINO_MONEY_CHARGE ~ This is called when they place a bet
//result = CASINO_MONEY_WIN ~ This is called if they win some money
//result = CASINO_MONEY_NOTENOUGH ~ This is called if they don't have enough to place the desired bet
forward OnCasinoStart(playerid, machineid); //Called when a Casino interface is opened
forward OnCasinoEnd(playerid, machineid); //Called when a Casino interface is closed
forward OnCasinoMessage(playerid, machineid, message[]); //Called when the casino has some text for the player, such as "Hold any or all of your cards"
stock CasinoGetPlayerMoney(playerid) {
return GetPlayerMoney(playerid);
}
#include <a_samp>
#include <core>
#include <float>
#include <GrimCasino>
main() {
print("----------------------------------");
print(" Bare Script");
print("----------------------------------");
}
public OnGameModeInit() {
CreateCasinoMachine(CASINO_MACHINE_POKER, 2034.9810, 1340.2120, 10.6517, 0.0000, 0.0000, -90.0000);
return 1;
}
public OnCasinoStart(playerid, machineid) {
new _type;
if (GetMachineType(machineid, _type)) {
if (_type == CASINO_MACHINE_POKER) {
SendClientMessage(playerid, 0xFFFFFFFF, "[CASINO] Welcome to the Poker machine");
SendClientMessage(playerid, 0xFFFFFFFF, " > How to play:");
SendClientMessage(playerid, 0xFFFFFFFF, " > Select how many coins to wager, the more you wager, the higher your winnings");
SendClientMessage(playerid, 0xFFFFFFFF, " > If you wager 1 coin ($100) and your hand is a Straight, you will win $400");
SendClientMessage(playerid, 0xFFFFFFFF, " > For information on poker hands see: http://en.wikipedia.org/wiki/List_of_poker_hands");
}
}
}
public OnCasinoEnd(playerid, machineid) {
SendClientMessage(playerid, 0xFFFFFFFF, "[CASINO] Goodbye, Thanks for playing!");
}
public OnCasinoMessage(playerid, machineid, message[]) {
new _msg[128];
format(_msg, 128, "[CASINO] %s", message);
SendClientMessage(playerid, 0xFFFFFFFF, _msg);
}
public OnCasinoMoney(playerid, machineid, amount, result) {
new message[128];
if (result == CASINO_MONEY_CHARGE) {
GivePlayerMoney(playerid, (amount * -1));
format(message, 128, "[CASINO] You have been charged $%i", amount);
} else if (result == CASINO_MONEY_WIN) {
GivePlayerMoney(playerid, amount);
format(message, 128, "[CASINO] You have won $%i", amount);
} else {/*if (result == CASINO_MONEY_NOTENOUGH) {*/
format(message, 128, "[CASINO] You dont have $%i to place a bet!", amount);
}
SendClientMessage(playerid, 0xFFFFFFFF, message);
}
stock CasinoGetPlayerMoney(playerid) {
return GetPlayerMoney(playerid);
}
Thanks
![]() If I get some time ill work on the other casino games. About the download, its the source as a pastebin, ill upload the file, and update the thread, thanks ![]() |
C:\Users\AEROTA~1\Desktop\LS-RP\pawno\include\GrimCasino.inc(1172) : warning 201: redefinition of constant/macro (symbol "OnGameModeInit") C:\Users\AEROTA~1\Desktop\LS-RP\pawno\include\GrimCasino.inc(1173) : warning 201: redefinition of constant/macro (symbol "OnPlayerConnect") C:\Users\Aerotactics' PC\Desktop\LS-RP\gamemodes\LS-RP.pwn(108) : error 017: undefined symbol "useDynamicObj" C:\Users\Aerotactics' PC\Desktop\LS-RP\gamemodes\LS-RP.pwn(108) : warning 215: expression has no effect C:\Users\Aerotactics' PC\Desktop\LS-RP\gamemodes\LS-RP.pwn(108) : error 001: expected token: ";", but found ")" C:\Users\Aerotactics' PC\Desktop\LS-RP\gamemodes\LS-RP.pwn(108) : error 029: invalid expression, assumed zero C:\Users\Aerotactics' PC\Desktop\LS-RP\gamemodes\LS-RP.pwn(108) : fatal error 107: too many error messages on one line
CreateCasinoMachine(CASINO_MACHINE_POKER,1565.4,-2330.8,13.2, 0, 0, 0, useDynamicObj=1);
cPoker_checkGame(playerid) {
new suit_a = cPoker_checkGameContains(playerid, CARD_ACE, CARD_TYPE_NONE, CPOKER_CHECKMODE_CARDSUIT);
////printf("suit_a: %i", suit_a);
new suit_2 = cPoker_checkGameContains(playerid, 2, CARD_TYPE_NONE, CPOKER_CHECKMODE_CARDSUIT);
////printf("suit_2: %i", suit_2);
new suit_3 = cPoker_checkGameContains(playerid, 3, CARD_TYPE_NONE, CPOKER_CHECKMODE_CARDSUIT);
////printf("suit_3: %i", suit_3);
new suit_4 = cPoker_checkGameContains(playerid, 4, CARD_TYPE_NONE, CPOKER_CHECKMODE_CARDSUIT);
////printf("suit_4: %i", suit_4);
new suit_5 = cPoker_checkGameContains(playerid, 5, CARD_TYPE_NONE, CPOKER_CHECKMODE_CARDSUIT);
////printf("suit_5: %i", suit_5);
if (c_suitsEqual(suit_a,suit_2,suit_3,suit_4,suit_5)) {
////print("CHECK_ROYALFLUSH");
return CHECK_ROYALFLUSH;
}
new suit_10 = cPoker_checkGameContains(playerid, 10, CARD_TYPE_NONE, CPOKER_CHECKMODE_CARDSUIT);
////printf("suit_10: %i", suit_10);
new suit_j = cPoker_checkGameContains(playerid, CARD_JACK, CARD_TYPE_NONE, CPOKER_CHECKMODE_CARDSUIT);
////printf("suit_j: %i", suit_j);
new suit_q = cPoker_checkGameContains(playerid, CARD_QUEEN, CARD_TYPE_NONE, CPOKER_CHECKMODE_CARDSUIT);
////printf("suit_q: %i", suit_q);
new suit_k = cPoker_checkGameContains(playerid, CARD_KING, CARD_TYPE_NONE, CPOKER_CHECKMODE_CARDSUIT);
////printf("suit_k: %i", suit_k);
if (c_suitsEqual(suit_10,suit_j,suit_q,suit_k,suit_a)) {
////print("CHECK_ROYALFLUSH");
return CHECK_ROYALFLUSH;
}
new suit_6 = cPoker_checkGameContains(playerid, 6, CARD_TYPE_NONE, CPOKER_CHECKMODE_CARDSUIT);
////printf("suit_6: %i", suit_6);
new suit_7 = cPoker_checkGameContains(playerid, 7, CARD_TYPE_NONE, CPOKER_CHECKMODE_CARDSUIT);
////printf("suit_7: %i", suit_7);
new suit_8 = cPoker_checkGameContains(playerid, 8, CARD_TYPE_NONE, CPOKER_CHECKMODE_CARDSUIT);
////printf("suit_8: %i", suit_8);
new suit_9 = cPoker_checkGameContains(playerid, 9, CARD_TYPE_NONE, CPOKER_CHECKMODE_CARDSUIT);
////printf("suit_9: %i", suit_9);
////print("CHECK_STRAIGHTFLUSH - START");
if (c_suitsEqual(suit_2,suit_3,suit_4,suit_5,suit_6)) {
return CHECK_STRAIGHTFLUSH;
} else if (c_suitsEqual(suit_3,suit_4,suit_5,suit_6,suit_7)) {
return CHECK_STRAIGHTFLUSH;
} else if (c_suitsEqual(suit_4,suit_5,suit_6,suit_7,suit_8)) {
return CHECK_STRAIGHTFLUSH;
} else if (c_suitsEqual(suit_5,suit_6,suit_7,suit_8,suit_9)) {
return CHECK_STRAIGHTFLUSH;
} else if (c_suitsEqual(suit_6,suit_7,suit_8,suit_9,suit_10)) {
return CHECK_STRAIGHTFLUSH;
} else if (c_suitsEqual(suit_7,suit_8,suit_9,suit_10,suit_j)) {
return CHECK_STRAIGHTFLUSH;
} else if (c_suitsEqual(suit_8,suit_9,suit_10,suit_j,suit_q)) {
return CHECK_STRAIGHTFLUSH;
} else if (c_suitsEqual(suit_9,suit_10,suit_j,suit_q,suit_k)) {
return CHECK_STRAIGHTFLUSH;
}
////print("CHECK_STRAIGHTFLUSH - END");
new countC[13];
////print("CHECK_FOUROFAKIND - START");
for (new _c=0; _c<5; _c++) {
new _n = cPokerGame[playerid][_c][1];
////printf("_n: %i", _n);
countC[_n-1]++;
if (countC[_n-1]==4) {
////print("CHECK_FOUROFAKIND");
return CHECK_FOUROFAKIND;
}
}
////print("CHECK_FOUROFAKIND - END");
////print("CHECK_FULLHOUSE - START");
for (new _card=1; _card<=13; _card++) {
if (countC[_card-1]==3) {
for (new _subCard=1; _subCard<=13; _subCard++) {
if (_subCard != _card) {
if (countC[_subCard-1]==2) {
//print("CHECK_FULLHOUSE");
return CHECK_FULLHOUSE;
}
}
}
}
}
////print("CHECK_FULLHOUSE - END");
if (c_Equal(cPokerGame[playerid][0][0],cPokerGame[playerid][1][0],cPokerGame[playerid][2][0],cPokerGame[playerid][3][0],cPokerGame[playerid][4][0])) {
////print("CHECK_FLUSH");
return CHECK_FLUSH;
}
////print("CHECK_STRAIGHT - START");
if (c_anySuits(suit_a,suit_2,suit_3,suit_4,suit_5)) {
return CHECK_STRAIGHT;
} else if (c_anySuits(suit_2,suit_3,suit_4,suit_5,suit_6)) {
return CHECK_STRAIGHT;
} else if (c_anySuits(suit_3,suit_4,suit_5,suit_6,suit_7)) {
return CHECK_STRAIGHT;
} else if (c_anySuits(suit_4,suit_5,suit_6,suit_7,suit_8)) {
return CHECK_STRAIGHT;
} else if (c_anySuits(suit_5,suit_6,suit_7,suit_8,suit_9)) {
return CHECK_STRAIGHT;
} else if (c_anySuits(suit_6,suit_7,suit_8,suit_9,suit_10)) {
return CHECK_STRAIGHT;
} else if (c_anySuits(suit_7,suit_8,suit_9,suit_10,suit_j)) {
return CHECK_STRAIGHT;
} else if (c_anySuits(suit_8,suit_9,suit_10,suit_j,suit_q)) {
return CHECK_STRAIGHT;
} else if (c_anySuits(suit_9,suit_10,suit_j,suit_q,suit_k)) {
return CHECK_STRAIGHT;
} else if (c_anySuits(suit_10,suit_j,suit_q,suit_k,suit_a)) {
return CHECK_STRAIGHT;
}
////print("CHECK_STRAIGHT - END");
////print("CHECK_THREEOFAKIND - START");
for (new _card=1; _card<=13; _card++) {
if (countC[_card-1]==3) {
for (new _subCard=1; _subCard<=13; _subCard++) {
if (_subCard != _card) {
if (countC[_subCard-1]==1) {
for (new _subSubCard=1; _subSubCard<=13; _subSubCard++) {
if (_subCard != _card && _subSubCard != _card && _subCard != _subSubCard) {
if (countC[_subSubCard-1]==1) {
return CHECK_THREEOFAKIND;
}
}
}
}
}
}
}
}
////print("CHECK_THREEOFAKIND - END");
////print("CHECK_TWOPAIRS - START");
for (new _card=1; _card<=13; _card++) {
////printf("_card: %i", _card);
if (countC[_card-1]==2) {
////printf("countC[_card-1]: %i", countC[_card-1]);
for (new _subCard=1; _subCard<=13; _subCard++) {
////printf("_subCard: %i", _subCard);
if (_subCard != _card) {
if (countC[_subCard-1]==2) {
////printf("countC[_subCard-1]: %i", countC[_subCard-1]);
return CHECK_TWOPAIRS;
}
}
}
}
}
////print("CHECK_TWOPAIRS - END");
////print("CHECK_JACKORBETTER - START");
for (new _c=0; _c<5; _c++) {
new _c_v = cPokerGame[playerid][_c][1];
if (_c_v >= CARD_JACK || _c_v == CARD_ACE) {
return CHECK_JACKORBETTER;
}
}
////print("CHECK_JACKORBETTER - END");
return CHECK_NONE;
}
warning 201: redefinition of constant/macro (symbol "OnGameModeInit") warning 201: redefinition of constant/macro (symbol "OnPlayerConnect") warning 201: redefinition of constant/macro (symbol "OnPlayerClickTextDraw") warning 201: redefinition of constant/macro (symbol "OnPlayerClickPlayerTextDraw")
Code:
warning 201: redefinition of constant/macro (symbol "OnGameModeInit") warning 201: redefinition of constant/macro (symbol "OnPlayerConnect") warning 201: redefinition of constant/macro (symbol "OnPlayerClickTextDraw") warning 201: redefinition of constant/macro (symbol "OnPlayerClickPlayerTextDraw") |
You did a good design on the textdraw and the script looks good to me, I would suggest that you would use Normal Per-Player Array/Var instead of using PVar, you should look into this thread about PVar and its disadvantage and advantage: https://sampforum.blast.hk/showthread.php?tid=268499
|
C:\Users\AEROTA~1\Desktop\LS-RP\pawno\include\GrimCasino.inc(819) : error 017: undefined symbol "CasinoGetPlayerMoney" |
Not quite fixed, just ran "#include <GrimCasino>" with my script and got:
Thanks for keeping me updated though! Looking forward to next update, will probably be in bed soon though so, tomorrow. |
stock CasinoGetPlayerMoney(playerid) {
return GetPlayerMoney(playerid);
}
#define OnPlayerClickPlayerTextDraw MP_OPCPTD
native CountAllCasinoMachine();
I get this in here:
Код:
#define OnPlayerClickPlayerTextDraw MP_OPCPTD |
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; }
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); } } } } }