12.03.2015, 17:24
Hi guys,i worked on pawno and decided create my Mode ).
I created first system "Orel and Reshka(Russian)"
Basically, the system needs to check the player's luck and make some money)
Go.
Defines:
New:
OnPlayerCommand:
OnDialogResponse:
P.S I used standart command processor
Good Luck!
I created first system "Orel and Reshka(Russian)"
Basically, the system needs to check the player's luck and make some money)
Go.
Defines:
Code:
#define prizedollars 500//Prize $ #define costor 500//Command Cost #define OREL_RESHKA_DL 123//Dialog #define OREL_RESHKA_DL_1 1231//Dialog 1_1 #define OREL_RESHKA_DL_2 1232//Dialog 1_2
Code:
new lucky[MAX_PLAYERS]; new choose[MAX_PLAYERS];
Code:
if(strcmp(cmd, "/lucky", true) == 0) { if(GetPlayerMoney(playerid) < costor){ new str[128]; format(str,sizeof(str),"You don`t have %d dollars!",costor); SendClientMessage(playerid,-1,str); return 1;} else{ GivePlayerMoney(playerid,costor); ShowPlayerDialog(playerid,OREL_RESHKA_DL,DIALOG_STYLE_MSGBOX,"Orel Reshka","Choose:","Orel","Reshka"); return 1;} }
Code:
if(dialogid == OREL_RESHKA_DL) { new str[256]; if(response) { choose[playerid] = 1; new rand = random(7); new stringer[10]; switch(rand) { case 0:lucky[playerid] = 1,stringer = "Orel"; case 1:lucky[playerid] = 2,stringer = "Reshka"; case 2:lucky[playerid] = 2,stringer = "Reshka"; case 3:lucky[playerid] = 2,stringer = "Reshka"; case 4:lucky[playerid] = 2,stringer = "Reshka"; case 5:lucky[playerid] = 2,stringer = "Reshka"; case 6:lucky[playerid] = 1,stringer = "Orel"; } new str1[64]; format(str1,sizeof(str1),"%s",stringer); if(lucky[playerid] == choose[playerid]){ format(str,sizeof(str),"Answer: %s\nCongratulations, you guessed it!",str1); ShowPlayerDialog(playerid,OREL_RESHKA_DL_1,DIALOG_STYLE_MSGBOX,"Orel Reshka",str,"Thank",""); } else if(lucky[playerid] != choose[playerid]){ format(str,sizeof(str),"Answer: %s\nSorry you are wrong!",str1); ShowPlayerDialog(playerid,OREL_RESHKA_DL_2,DIALOG_STYLE_MSGBOX,"Orel Reshka",str,"Falied",""); } } else { choose[playerid] = 2; new rand = random(7); new stringer[10]; switch(rand) { case 0:lucky[playerid] = 1,stringer = "Orel"; case 1:lucky[playerid] = 1,stringer = "Orel"; case 2:lucky[playerid] = 2,stringer = "Reshka"; case 3:lucky[playerid] = 2,stringer = "Reshka"; case 4:lucky[playerid] = 1,stringer = "Orel"; case 5:lucky[playerid] = 1,stringer = "Orel"; case 6:lucky[playerid] = 1,stringer = "Orel"; } new str1[64]; format(str1,sizeof(str1),"%s",stringer); if(lucky[playerid] == choose[playerid]){ format(str,sizeof(str),"Answer: %s\nCongratulations, you guessed it!",str1); ShowPlayerDialog(playerid,OREL_RESHKA_DL_1,DIALOG_STYLE_MSGBOX,"Orel Reshka",str,"Thank",""); } else if(lucky[playerid] != choose[playerid]){ format(str,sizeof(str),"Answer: %s\nSorry you are wrong!",str1); ShowPlayerDialog(playerid,OREL_RESHKA_DL_2,DIALOG_STYLE_MSGBOX,"Orel Reshka",str,"Falied",""); } } } if(dialogid == OREL_RESHKA_DL_1){ new money = prizedollars;//Prize GivePlayerMoney(playerid,money); SendClientMessage(playerid,-1,"You can also test your luck again!:)"); return 1; } if(dialogid == OREL_RESHKA_DL_2){ SendClientMessage(playerid,-1,"Do not worry, you can be lucky next time!:("); return 1; }
Good Luck!