Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Function()
- {
- else if(equali(iArgs[0] , "/gamble") || equali(iArgs[0],"!gamble"))
- {
- if (!get_pcvar_num(g_Cvar[ENABLED]) || get_pcvar_num(g_Cvar[ENABLED]) && !get_pcvar_num(g_Cvar[GAMBLE]))
- return 1;
- new pointnum = str_to_num(iArgs[1]);
- if(!is_str_num(iArgs[1]))
- {
- ColorChat(id,"You ^3must ^1enter ^1numbers^1!");
- return 1;
- }
- else if(!check_points(id,pointnum))
- {
- ColorChat(id,"You ^3don't ^1have enough ^3points^1!");
- return 1;
- }
- else if(pointnum < 200)
- {
- ColorChat(id,"You ^3must ^1gamble on more than^4 200 ^3points^1!");
- return 1;
- }
- new szName[32];
- get_user_name(id, szName, charsmax(szName));
- new GambledNum;
- GambledNum = random_num(1,100);
- switch(GambledNum)
- {
- case 1..54:
- {
- ColorChat(0,"The player ^3%s^1 has gambled on ^4%i^1 cash and ^3lost^1!",szName,pointnum,GambledNum);
- g_points[id] -= pointnum;
- do_effect(id,0,1);
- return 1;
- }
- case 55..100:
- {
- ColorChat(0,"The player ^3%s^1 has gambled on ^4%i^1 cash and ^3WON^1!",szName,pointnum,GambledNum);
- g_points[id] += pointnum;
- if (!max_points(id))
- g_points[id] = get_pcvar_num(g_Cvar[MAX_POINTS]);
- return 1;
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment