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; }
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;
}
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 код:
|