SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 12/06/2018, 04:05 PM   #1
SlayerHodge
Little Clucker
 
Join Date: Jun 2016
Posts: 42
Reputation: 0
Default Casino Dealer System(TExtdraw related)

IDEA: with in this system i was expecting to have a local chat which would be generated for every individual deaalers, The idea was to minimize spamming or interference from other dealers, because how the system is at the moment it just sends to the nearby people the roulette's spin result. In fullness, I would like to make a join/jointable command, where by it will select the dealers id, create a local room with a minor textdraw. The text draw will be responsible for keeping intact what players bet. For exaample 20 people bet red, the dealer must be able to view individual bets to make sure they have betted on that specific result.

Issue i am having: The issue is I am unaware on how to use make the local room.

code:
Code:
enum pstats
{
dealer,
}
enum ptemps
{
dealerduty,
}
forward RouletteTimer(playerid);
public RouletteTimer(playerid)
{
	new string[MAX_STRING]; //
	switch(random(36))
	{
		case 0:
		{
            if(PlayerTemp[playerid][hname]==1)
            {
		        format(string,sizeof(string),"*The wheel lands on 0 (Green)* (( Stranger[%d] ))",PlayerInfo[playerid][strangerid]);
				NearMessage(playerid,string,COLOR_GREEN);
		    }
		    else
			{
			format(string,sizeof(string),"*The wheel lands on 0 (Green)* (( %s ))",RPName(playerid));
			NearMessage(playerid,string,COLOR_GREEN);
			}
			return 1;
		}
		case 1:
		{
			  if(PlayerTemp[playerid][hname]==1)
            {
		        format(string,sizeof(string),"*The wheel lands on 1 (Red)* (( Stranger[%d] ))",PlayerInfo[playerid][strangerid]);
				NearMessage(playerid,string,COLOR_GREEN);
		    }
		    else
			{
			format(string,sizeof(string),"*The wheel lands on 1 (Red)* (( %s ))",RPName(playerid));
			NearMessage(playerid,string,COLOR_GREEN);
			}
			return 1;
		}
		case 2:
		{
		  	if(PlayerTemp[playerid][hname]==1)
            {
		        format(string,sizeof(string),"*The wheel lands on 2 (Black)* (( Stranger[%d] ))",PlayerInfo[playerid][strangerid]);
				NearMessage(playerid,string,COLOR_GREEN);
		    }
		    else
			{
			format(string,sizeof(string),"*The wheel lands on 2 (Black)* (( %s ))",RPName(playerid));
			NearMessage(playerid,string,COLOR_GREEN);
			}
			return 1;
		}
		case 3:
		{
			  if(PlayerTemp[playerid][hname]==1)
            {
		        format(string,sizeof(string),"*The wheel lands on 3 (Red)* (( Stranger[%d] ))",PlayerInfo[playerid][strangerid]);
				NearMessage(playerid,string,COLOR_GREEN);
		    }
		    else
			{
			format(string,sizeof(string),"*The wheel lands on 3 (Red)* (( %s ))",RPName(playerid));
			NearMessage(playerid,string,COLOR_GREEN);
			}
			return 1;
		}
		case 4:
		{
			  if(PlayerTemp[playerid][hname]==1)
            {
		        format(string,sizeof(string),"*The wheel lands on 4 (Black)* (( Stranger[%d] ))",PlayerInfo[playerid][strangerid]);
				NearMessage(playerid,string,COLOR_GREEN);
		    }
		    else
			{
			format(string,sizeof(string),"*The wheel lands on 4 (Black)* (( %s ))",RPName(playerid));
			NearMessage(playerid,string,COLOR_GREEN);
			}
			return 1;
		}
		case 5:
		{
		  if(PlayerTemp[playerid][hname]==1)
            {
		        format(string,sizeof(string),"*The wheel lands on 5(Red)* (( Stranger[%d] ))",PlayerInfo[playerid][strangerid]);
				NearMessage(playerid,string,COLOR_GREEN);
		    }
		    else
			{
			format(string,sizeof(string),"*The wheel lands on 5 (Red)* (( %s ))",RPName(playerid));
			NearMessage(playerid,string,COLOR_GREEN);
			}
			return 1;
		}
		case 6:
		{
			  if(PlayerTemp[playerid][hname]==1)
            {
		        format(string,sizeof(string),"*The wheel lands on 6 (Black)* (( Stranger[%d] ))",PlayerInfo[playerid][strangerid]);
				NearMessage(playerid,string,COLOR_GREEN);
		    }
		    else
			{
			format(string,sizeof(string),"*The wheel lands on 6 (Black)* (( %s ))",RPName(playerid));
			NearMessage(playerid,string,COLOR_GREEN);
			}
			return 1;
		}
		case 7:
		{
			  if(PlayerTemp[playerid][hname]==1)
            {
		        format(string,sizeof(string),"*The wheel lands on 7 (Red)* (( Stranger[%d] ))",PlayerInfo[playerid][strangerid]);
				NearMessage(playerid,string,COLOR_GREEN);
		    }
		    else
			{
			format(string,sizeof(string),"*The wheel lands on 7 (Red)* (( %s ))",RPName(playerid));
			NearMessage(playerid,string,COLOR_GREEN);
			}
			return 1;
		}
		case 8:
		{
			  if(PlayerTemp[playerid][hname]==1)
            {
		        format(string,sizeof(string),"*The wheel lands on 8 (Black)* (( Stranger[%d] ))",PlayerInfo[playerid][strangerid]);
				NearMessage(playerid,string,COLOR_GREEN);
		    }
		    else
			{
			format(string,sizeof(string),"*The wheel lands on 8 (Black)* (( %s ))",RPName(playerid));
			NearMessage(playerid,string,COLOR_GREEN);
			}
			return 1;
		}
		case 9:
		{
			  if(PlayerTemp[playerid][hname]==1)
            {
		        format(string,sizeof(string),"*The wheel lands on 9 (Red)* (( Stranger[%d] ))",PlayerInfo[playerid][strangerid]);
				NearMessage(playerid,string,COLOR_GREEN);
		    }
		    else
			{
			format(string,sizeof(string),"*The wheel lands on 9 (Red)* (( %s ))",RPName(playerid));
			NearMessage(playerid,string,COLOR_GREEN);
			}
			return 1;
		}
		case 10:
		{
			  if(PlayerTemp[playerid][hname]==1)
            {
		        format(string,sizeof(string),"*The wheel lands on 10 (Black)* (( Stranger[%d] ))",PlayerInfo[playerid][strangerid]);
				NearMessage(playerid,string,COLOR_GREEN);
		    }
		    else
			{
			format(string,sizeof(string),"*The wheel lands on 10 (Black)* (( %s ))",RPName(playerid));
			NearMessage(playerid,string,COLOR_GREEN);
			}
			return 1;
		}
		case 11:
		{
			  if(PlayerTemp[playerid][hname]==1)
            {
		        format(string,sizeof(string),"*The wheel lands on 11 (Red)* (( Stranger[%d] ))",PlayerInfo[playerid][strangerid]);
				NearMessage(playerid,string,COLOR_GREEN);
		    }
		    else
			{
			format(string,sizeof(string),"*The wheel lands on 11 (Red)* (( %s ))",RPName(playerid));
			NearMessage(playerid,string,COLOR_GREEN);
			}
			return 1;
		}
		case 12:
		{
			  if(PlayerTemp[playerid][hname]==1)
            {
		        format(string,sizeof(string),"*The wheel lands on 12 (Black)* (( Stranger[%d] ))",PlayerInfo[playerid][strangerid]);
				NearMessage(playerid,string,COLOR_GREEN);
		    }
		    else
			{
			format(string,sizeof(string),"*The wheel lands on 12 (Black)* (( %s ))",RPName(playerid));
			NearMessage(playerid,string,COLOR_GREEN);
			}
			return 1;
		}
		case 13:
		{
		  if(PlayerTemp[playerid][hname]==1)
            {
		        format(string,sizeof(string),"*The wheel lands on 13 (Red)* (( Stranger[%d] ))",PlayerInfo[playerid][strangerid]);
				NearMessage(playerid,string,COLOR_GREEN);
		    }
		    else
			{
			format(string,sizeof(string),"*The wheel lands on 13 (Red)* (( %s ))",RPName(playerid));
			NearMessage(playerid,string,COLOR_GREEN);
			}
			return 1;
		}
		case 14:
		{
			  if(PlayerTemp[playerid][hname]==1)
            {
		        format(string,sizeof(string),"*The wheel lands on 14 (Black)* (( Stranger[%d] ))",PlayerInfo[playerid][strangerid]);
				NearMessage(playerid,string,COLOR_GREEN);
		    }
		    else
			{
			format(string,sizeof(string),"*The wheel lands on 14 (Black)* (( %s ))",RPName(playerid));
			NearMessage(playerid,string,COLOR_GREEN);
			}
			return 1;
		}
		case 15:
		{
			  if(PlayerTemp[playerid][hname]==1)
            {
		        format(string,sizeof(string),"*The wheel lands on 15 (Black)* (( Stranger[%d] ))",PlayerInfo[playerid][strangerid]);
				NearMessage(playerid,string,COLOR_GREEN);
		    }
		    else
			{
			format(string,sizeof(string),"*The wheel lands on 15 (Black)* (( %s ))",RPName(playerid));
			NearMessage(playerid,string,COLOR_GREEN);
			}
			return 1;
		}
		case 16:
		{
			  if(PlayerTemp[playerid][hname]==1)
            {
		        format(string,sizeof(string),"*The wheel lands on 16 (Red)* (( Stranger[%d] ))",PlayerInfo[playerid][strangerid]);
				NearMessage(playerid,string,COLOR_GREEN);
		    }
		    else
			{
			format(string,sizeof(string),"*The wheel lands on 16 (Red)* (( %s ))",RPName(playerid));
			NearMessage(playerid,string,COLOR_GREEN);
			}
			return 1;
		}
		case 17:
		{
			  if(PlayerTemp[playerid][hname]==1)
            {
		        format(string,sizeof(string),"*The wheel lands on 17 (Black)* (( Stranger[%d] ))",PlayerInfo[playerid][strangerid]);
				NearMessage(playerid,string,COLOR_GREEN);
		    }
		    else
			{
			format(string,sizeof(string),"*The wheel lands on 17(Black)* (( %s ))",RPName(playerid));
			NearMessage(playerid,string,COLOR_GREEN);
			}
			return 1;
		}
		case 18:
		{
			  if(PlayerTemp[playerid][hname]==1)
            {
		        format(string,sizeof(string),"*The wheel lands on 18(Red)* (( Stranger[%d] ))",PlayerInfo[playerid][strangerid]);
				NearMessage(playerid,string,COLOR_GREEN);
		    }
		    else
			{
			format(string,sizeof(string),"*The wheel lands on 18 (Red)* (( %s ))",RPName(playerid));
			NearMessage(playerid,string,COLOR_GREEN);
			}
			return 1;
		}
		case 19:
		{
			  if(PlayerTemp[playerid][hname]==1)
            {
		        format(string,sizeof(string),"*The wheel lands on 19 (Black)* (( Stranger[%d] ))",PlayerInfo[playerid][strangerid]);
				NearMessage(playerid,string,COLOR_GREEN);
		    }
		    else
			{
			format(string,sizeof(string),"*The wheel lands on 19 (Black)* (( %s ))",RPName(playerid));
			NearMessage(playerid,string,COLOR_GREEN);
			}
			return 1;
		}
		case 20:
		{
			  if(PlayerTemp[playerid][hname]==1)
            {
		        format(string,sizeof(string),"*The wheel lands on 20 (Red)* (( Stranger[%d] ))",PlayerInfo[playerid][strangerid]);
				NearMessage(playerid,string,COLOR_GREEN);
		    }
		    else
			{
			format(string,sizeof(string),"*The wheel lands on 20 (Red)* (( %s ))",RPName(playerid));
			NearMessage(playerid,string,COLOR_GREEN);
			}
			return 1;
		}
		case 21:
		{
			  if(PlayerTemp[playerid][hname]==1)
            {
		        format(string,sizeof(string),"*The wheel lands on 21 (Black)* (( Stranger[%d] ))",PlayerInfo[playerid][strangerid]);
				NearMessage(playerid,string,COLOR_GREEN);
		    }
		    else
			{
			format(string,sizeof(string),"*The wheel lands on 21 (Black)* (( %s ))",RPName(playerid));
			NearMessage(playerid,string,COLOR_GREEN);
			}
			return 1;
		}
		case 22:
		{
			  if(PlayerTemp[playerid][hname]==1)
            {
		        format(string,sizeof(string),"*The wheel lands on 22(Red)* (( Stranger[%d] ))",PlayerInfo[playerid][strangerid]);
				NearMessage(playerid,string,COLOR_GREEN);
		    }
		    else
			{
			format(string,sizeof(string),"*The wheel lands on 22 (Red)* (( %s ))",RPName(playerid));
			NearMessage(playerid,string,COLOR_GREEN);
			}
			return 1;
		}
		case 23:
		{
			  if(PlayerTemp[playerid][hname]==1)
            {
		        format(string,sizeof(string),"*The wheel lands on 23(Black)* (( Stranger[%d] ))",PlayerInfo[playerid][strangerid]);
				NearMessage(playerid,string,COLOR_GREEN);
		    }
		    else
			{
			format(string,sizeof(string),"*The wheel lands on 23 (Red)* (( %s ))",RPName(playerid));
			NearMessage(playerid,string,COLOR_GREEN);
			}
			return 1;
		}
		case 24:
		{
			  if(PlayerTemp[playerid][hname]==1)
            {
		        format(string,sizeof(string),"*The wheel lands on 24 (Black)* (( Stranger[%d] ))",PlayerInfo[playerid][strangerid]);
				NearMessage(playerid,string,COLOR_GREEN);
		    }
		    else
			{
			format(string,sizeof(string),"*The wheel lands on 24 (Black)* (( %s ))",RPName(playerid));
			NearMessage(playerid,string,COLOR_GREEN);
			}
			return 1;
		}
		case 25:
		{
			  if(PlayerTemp[playerid][hname]==1)
            {
		        format(string,sizeof(string),"*The wheel lands on 25 (Red)* (( Stranger[%d] ))",PlayerInfo[playerid][strangerid]);
				NearMessage(playerid,string,COLOR_GREEN);
		    }
		    else
			{
			format(string,sizeof(string),"*The wheel lands on 25 (Red)* (( %s ))",RPName(playerid));
			NearMessage(playerid,string,COLOR_GREEN);
			}
			return 1;
		}
		case 26:
		{
              if(PlayerTemp[playerid][hname]==1)
            {
		        format(string,sizeof(string),"*The wheel lands on 26 (Black)* (( Stranger[%d] ))",PlayerInfo[playerid][strangerid]);
				NearMessage(playerid,string,COLOR_GREEN);
		    }
		    else
			{
			format(string,sizeof(string),"*The wheel lands on 26 (Black)* (( %s ))",RPName(playerid));
			NearMessage(playerid,string,COLOR_GREEN);
			}

			return 1;
		}
		case 27:
		{
			  if(PlayerTemp[playerid][hname]==1)
            {
		        format(string,sizeof(string),"*The wheel lands on 27 (Red)* (( Stranger[%d] ))",PlayerInfo[playerid][strangerid]);
				NearMessage(playerid,string,COLOR_GREEN);
		    }
		    else
			{
			format(string,sizeof(string),"*The wheel lands on 27 (Red)* (( %s ))",RPName(playerid));
			NearMessage(playerid,string,COLOR_GREEN);
			}
			return 1;
		}
		case 28:
		{
			  if(PlayerTemp[playerid][hname]==1)
            {
		        format(string,sizeof(string),"*The wheel lands on 28 (Black)* (( Stranger[%d] ))",PlayerInfo[playerid][strangerid]);
				NearMessage(playerid,string,COLOR_GREEN);
		    }
		    else
			{
			format(string,sizeof(string),"*The wheel lands on 28 (Black)* (( %s ))",RPName(playerid));
			NearMessage(playerid,string,COLOR_GREEN);
			}
			return 1;
		}
		case 29:
		{
			  if(PlayerTemp[playerid][hname]==1)
            {
		        format(string,sizeof(string),"*The wheel lands on 29 (Red)* (( Stranger[%d] ))",PlayerInfo[playerid][strangerid]);
				NearMessage(playerid,string,COLOR_GREEN);
		    }
		    else
			{
			format(string,sizeof(string),"*The wheel lands on 29 (Red)* (( %s ))",RPName(playerid));
			NearMessage(playerid,string,COLOR_GREEN);
			}
			return 1;
		}
		case 30:
		{
			  if(PlayerTemp[playerid][hname]==1)
            {
		        format(string,sizeof(string),"*The wheel lands on 30(Black)* (( Stranger[%d] ))",PlayerInfo[playerid][strangerid]);
				NearMessage(playerid,string,COLOR_GREEN);
		    }
		    else
			{
			format(string,sizeof(string),"*The wheel lands on 30 (Black)* (( %s ))",RPName(playerid));
			NearMessage(playerid,string,COLOR_GREEN);
			}
			return 1;
		}
		case 31:
		{
			  if(PlayerTemp[playerid][hname]==1)
            {
		        format(string,sizeof(string),"*The wheel lands on 31 (Red)* (( Stranger[%d] ))",PlayerInfo[playerid][strangerid]);
				NearMessage(playerid,string,COLOR_GREEN);
		    }
		    else
			{
			format(string,sizeof(string),"*The wheel lands on 31 (Red)* (( %s ))",RPName(playerid));
			NearMessage(playerid,string,COLOR_GREEN);
			}
			return 1;
		}
		case 32:
		{
			  if(PlayerTemp[playerid][hname]==1)
            {
		        format(string,sizeof(string),"*The wheel lands on 32 (Black)* (( Stranger[%d] ))",PlayerInfo[playerid][strangerid]);
				NearMessage(playerid,string,COLOR_GREEN);
		    }
		    else
			{
			format(string,sizeof(string),"*The wheel lands on 32 (Black)* (( %s ))",RPName(playerid));
			NearMessage(playerid,string,COLOR_GREEN);
			}
			return 1;
		}
		case 33:
		{
			  if(PlayerTemp[playerid][hname]==1)
            {
		        format(string,sizeof(string),"*The wheel lands on 33 (Red)* (( Stranger[%d] ))",PlayerInfo[playerid][strangerid]);
				NearMessage(playerid,string,COLOR_GREEN);
		    }
		    else
			{
			format(string,sizeof(string),"*The wheel lands on 33 (Red)* (( %s ))",RPName(playerid));
			NearMessage(playerid,string,COLOR_GREEN);
			}
			return 1;
		}
		case 34:
		{
			  if(PlayerTemp[playerid][hname]==1)
            {
		        format(string,sizeof(string),"*The wheel lands on 34 (Black)* (( Stranger[%d] ))",PlayerInfo[playerid][strangerid]);
				NearMessage(playerid,string,COLOR_GREEN);
		    }
		    else
			{
			format(string,sizeof(string),"*The wheel lands on 34 (Black)* (( %s ))",RPName(playerid));
			NearMessage(playerid,string,COLOR_GREEN);
			}
			return 1;
		}
		case 35:
		{
			  if(PlayerTemp[playerid][hname]==1)
            {
		        format(string,sizeof(string),"*The wheel lands on 35 (Red)* (( Stranger[%d] ))",PlayerInfo[playerid][strangerid]);
				NearMessage(playerid,string,COLOR_GREEN);
		    }
		    else
			{
			format(string,sizeof(string),"*The wheel lands on 35 (Red)* (( %s ))",RPName(playerid));
			NearMessage(playerid,string,COLOR_GREEN);
			}
			return 1;
		}
		case 36:
		{
			  if(PlayerTemp[playerid][hname]==1)
            {
		        format(string,sizeof(string),"*The wheel lands on 36 (Black)* (( Stranger[%d] ))",PlayerInfo[playerid][strangerid]);
				NearMessage(playerid,string,COLOR_GREEN);
		    }
		    else
			{
			format(string,sizeof(string),"*The wheel lands on 36(Black)* (( %s ))",RPName(playerid));
			NearMessage(playerid,string,COLOR_GREEN);
			}
			return 1;
		}
	}
	return 1;
}
/* The end of what Kevon AKA Kryptic Reviewed*/
COMMAND:roulette(playerid, params[])
{
	new tmpid = IsPlayerInBiz(playerid);
	new string[MAX_STRING];
	if(PlayerInfo[playerid][dealer] < 1)
	    return SendClientError(playerid, "You are not on duty to use this command !");
    	    if(PlayerTemp[playerid][dealerduty] < 1)
	    return SendClientError(playerid, "You are not on duty to use this command !");
	if(PlayerInfo[playerid][playerlvl] < 3)
	    return SendClientError(playerid, CANT_USE_CMD);
    if(tmpid != -1 && biz[tmpid][biztype] == 2 && GetPlayerVirtualWorld(playerid) == biz[tmpid][vbiz])
    {
     	if(PlayerTemp[playerid][hname]==1)format(string, sizeof(string), "Stranger[%d] has spinned the wheel...",PlayerInfo[playerid][strangerid]);
    	else format(string, sizeof(string), "%s has spinned the wheel...",RPName(playerid));
		NearMessage(playerid,string,COLOR_GREEN);
		SetTimerEx("RouletteTimer",4700,0,"i",playerid);
		return 1;
	}
	else return SendClientError(playerid,  "You need to be inside the casino to use this command");
}
forward BlackJackTimer(playerid);
public BlackJackTimer(playerid)
{
	new string[MAX_STRING]; //
	switch(random(11))
	{
		case 0:
		{
			format(string,sizeof(string),"*The card shows 1* (( %s ))",RPName(playerid));
			NearMessage(playerid,string,COLOR_GREEN);
			return 1;
		}
		case 1:
		{
			format(string,sizeof(string),"*The card shows 2* (( %s ))",RPName(playerid));
			NearMessage(playerid,string,COLOR_GREEN);
			return 1;
		}
		case 2:
		{
			format(string,sizeof(string),"*The card shows 3* (( %s ))",RPName(playerid));
			NearMessage(playerid,string,COLOR_GREEN);
			return 1;
		}
		case 3:
		{
			format(string,sizeof(string),"*The card shows 4* (( %s ))",RPName(playerid));
			NearMessage(playerid,string,COLOR_GREEN);
			return 1;
		}
		case 4:
		{
			format(string,sizeof(string),"*The card shows 5* (( %s ))",RPName(playerid));
			NearMessage(playerid,string,COLOR_GREEN);
			return 1;
		}
		case 5:
		{
			format(string,sizeof(string),"*The card shows 6* (( %s ))",RPName(playerid));
			NearMessage(playerid,string,COLOR_GREEN);
			return 1;
		}
		case 6:
		{
			format(string,sizeof(string),"*The card shows 7* (( %s ))",RPName(playerid));
			NearMessage(playerid,string,COLOR_GREEN);
			return 1;
		}
		case 7:
		{
			format(string,sizeof(string),"*The card shows 8* (( %s ))",RPName(playerid));
			NearMessage(playerid,string,COLOR_GREEN);
			return 1;
		}
		case 8:
		{
			format(string,sizeof(string),"*The card shows 9* (( %s ))",RPName(playerid));
			NearMessage(playerid,string,COLOR_GREEN);
			return 1;
		}
		case 9:
		{
			format(string,sizeof(string),"*The card shows 10* (( %s ))",RPName(playerid));
			NearMessage(playerid,string,COLOR_GREEN);
			return 1;
		}
		case 10:
		{
			format(string,sizeof(string),"*The card shows ACE* (( %s ))",RPName(playerid));
			NearMessage(playerid,string,COLOR_GREEN);
			return 1;
		}
	}
	return 1;
}
COMMAND:blackjack(playerid, params[])
{
	new tmpid=IsPlayerInBiz(playerid);
	new string[MAX_STRING];
		if(PlayerInfo[playerid][dealer] < 1)
	    return SendClientError(playerid, "You are not a dealer !");
	    if(PlayerTemp[playerid][dealerduty] < 1)
	    return SendClientError(playerid, "You are not on duty to use this command !");
	if(PlayerInfo[playerid][playerlvl] < 6)
	    return SendClientError(playerid, CANT_USE_CMD);
    if(tmpid!=-1 && biz[tmpid][biztype]==2 && GetPlayerVirtualWorld(playerid)==biz[tmpid][vbiz])
    {
    //Edited by Kryptic AKA Kevon
//    	new sender[MAX_STRING];
   		if(PlayerTemp[playerid][hname]==1) format(string, sizeof(string), "Stranger[%d] deals a card... **",PlayerInfo[playerid][strangerid]);
    	else format(string, sizeof(string), "%s deals a card... **",RPName(playerid));
		NearMessage(playerid,string,COLOR_GREEN);
		SetTimerEx("BlackJackTimer",3000,0,"i",playerid);
	//End of edit
		return 1;
	}
	return 1;
}
forward CoinTimer(playerid);
public CoinTimer(playerid)
{
	new string[MAX_STRING]; //
	switch(random(2))
	{
		case 0:
		{
			format(string,sizeof(string),"The coin lands on HEADS (( %s ))",RPName(playerid));
			NearMessage(playerid,string,COLOR_GREEN);
			return 1;
		}
		case 1:
		{
			format(string,sizeof(string),"The coin lands on TALES (( %s ))",RPName(playerid));
			NearMessage(playerid,string,COLOR_GREEN);
			return 1;
		}
	}
	return 1;
}
COMMAND:dealerduty(playerid, params[])
{
    if(PlayerInfo[playerid][playerlvl] == 0) return SendClientError(playerid, "You need to login in order to use this command!");
	if(!PlayerInfo[playerid][dealer]) return SendClientError(playerid, CANT_USE_CMD);
      new tmpid=IsPlayerInBiz(playerid);
//  new tmpid2=IsPlayerOutBiz(playerid);
  if(tmpid == -1 || biz[tmpid][biztype] !=2) return SendClientError(playerid, "You must be inside a casino to use this command.");
		//for(new i=0;i<MAX_PLAYERS;i++)
   /* if(!IsPlayerInRangeOfPoint(playerid, 60.0, 2229.9722,1613.4962,1006.1860)) return SendClientError(playerid, "You must be inside a casino to use this command!");
 {*/
	if(PlayerTemp[playerid][dealerduty] == 0)
	{
	    PlayerTemp[playerid][dealerduty] = 1;
	    SendClientInfo(playerid, "You are now on dealer duty.");
	    //SetPlayerChatBubble(i, "(( CASINO DEALER ))", 0xFFCC66AA, 50.0, 10000);
	}
	else
	{
 		PlayerTemp[playerid][dealerduty] = 0;
		SendClientInfo(playerid, "You are no longer on dealer duty.");
		//SetPlayerChatBubble(i, "", 0xFFCC66AA, 50.0, 10000);
	 }
	return 1;
}
Note: I would like for yoyu to assist me or explain how i can go about making a local chat, that is unique to every dealer, where by other players can connect and use to bet. Example, Jame_Ko and Kellon_tom has joined Keswi_ken's Table. along side them is another dealer who is also hosting, the results from teh roulette of each dealer would not collide, it only is available for the players that have Joined their table, Also, the Bets of the players on that table will be previewed on a textdraw.
__________________
SlayerHodge is offline   Reply With Quote
Old 12/06/2018, 06:04 PM   #2
CodeStyle175
Huge Clucker
 
CodeStyle175's Avatar
 
Join Date: Apr 2014
Posts: 438
Reputation: 34
Default Re: Casino Dealer System(TExtdraw related)

what is this thing why are you wasting so much rows with useless code
thats why you have variables, arrays and other things that you dont have to write such sutpid code over and over again.
PHP Code:
forward RouletteTimer(playerid);
public 
RouletteTimer(playerid){
    
//Green,Red,Black
    
new string[MAX_STRING],rnd=random(36)+1,color[10];
    if        (
rnd%3==0)color="Black";
    else if    (
rnd%2==0)color="Red";
    else if    (
rnd%1==0)color="Green";
    
format(string,sizeof(string),"* The wheel lands on %d (%s)* (( %s ))",rnd,color,RPName(playerid);
    
NearMessage(playerid,string,COLOR_GREEN);
    return 
1;
}
forward BlackJackTimer(playerid);
public 
BlackJackTimer(playerid)
{
    new 
string[MAX_STRING]; //
    
format(string,sizeof(string),"*The card shows %d* (( %s ))",random(11)+1,RPName(playerid));
    
NearMessage(playerid,string,COLOR_GREEN);
    return 
1;

CodeStyle175 is offline   Reply With Quote
Old 12/06/2018, 08:37 PM   #3
SlayerHodge
Little Clucker
 
Join Date: Jun 2016
Posts: 42
Reputation: 0
Default Re: Casino Dealer System(TExtdraw related)

Quote:
Originally Posted by CodeStyle175 View Post
what is this thing why are you wasting so much rows with useless code
thats why you have variables, arrays and other things that you dont have to write such sutpid code over and over again.
PHP Code:
forward RouletteTimer(playerid);
public 
RouletteTimer(playerid){
    
//Green,Red,Black
    
new string[MAX_STRING],rnd=random(36)+1,color[10];
    if        (
rnd%3==0)color="Black";
    else if    (
rnd%2==0)color="Red";
    else if    (
rnd%1==0)color="Green";
    
format(string,sizeof(string),"* The wheel lands on %d (%s)* (( %s ))",rnd,color,RPName(playerid);
    
NearMessage(playerid,string,COLOR_GREEN);
    return 
1;
}
forward BlackJackTimer(playerid);
public 
BlackJackTimer(playerid)
{
    new 
string[MAX_STRING]; //
    
format(string,sizeof(string),"*The card shows %d* (( %s ))",random(11)+1,RPName(playerid));
    
NearMessage(playerid,string,COLOR_GREEN);
    return 
1;

Thanks for that advise, will reduce the code length.

Anyway, i still have the issue where by i am not getting the local table that is only acessible by the players of which joined that specific table.
__________________
SlayerHodge is offline   Reply With Quote
Old 13/06/2018, 08:02 PM   #4
SlayerHodge
Little Clucker
 
Join Date: Jun 2016
Posts: 42
Reputation: 0
Default Re: Casino Dealer System(TExtdraw related)

I have a question as it relates to textdraw, is it possible to make a room/group whereby it pultrays User's bet and name with money betted? The purpose of this room is basically, when the dealer is on duty, he would open a table/room, where by if players want's to play they neeed to join that dealers table. whilst in this room/table only the Dealer assigned to that table will have the roulette/blackjack results shown to players. purposee is to minimise confusion /spam and keep track of who payed what for which bet(s)
__________________
SlayerHodge is offline   Reply With Quote
Old 17/06/2018, 11:00 AM   #5
SlayerHodge
Little Clucker
 
Join Date: Jun 2016
Posts: 42
Reputation: 0
Default Re: Casino Dealer System(TExtdraw related)

Okay, due to noone responding to mmy question, i started and just require one part.
I have made an Enum that stores a value called dealertable id, made a global variable that is called dealerstableid, what I did is when the player types /jointable ((playerid)) the command will first check if the player is a dealer, if he is it will proceed to checking, for that player's dealertableid and ddealerstable id. NOw within player stat change, I made a command that checks the distance of the player's and the dealer table they joined. if they exceed specific range they are removeed, now! this is where my complications comein. I was thinking of doing, a check on who's table you joined and depending on that tableid use showallplayersdialogid to them, BUt their is 2 issues, Idk how to use ddialog's well.

So i dont know how to place a list of player's names when they have betted on that dialoglist with their bet's
__________________
SlayerHodge 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
Casino Dealer system(Local areachat and Textdraw assistance) SlayerHodge Server Support 0 12/06/2018 02:41 PM
Dealer ship textdraw problem JawsPlus Scripting Help 3 24/04/2016 06:32 AM
Dealer ship textdraw problem JawsPlus Scripting Help 5 24/04/2016 06:27 AM
Dialogs Related And Textdraw Related X|Dragon|X Scripting Help 1 21/04/2015 02:40 PM
Casino Dealer RedCode Scripting Help 2 02/03/2015 11:46 PM


All times are GMT. The time now is 01:38 PM.


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