Raised This Month: $ Target: $400
 0% 

Rock Paper Scissors v1.0 BETA by Rejack


Post New Thread Reply   
 
Thread Tools Display Modes
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 07-10-2013 , 06:12   Re: Rock Paper Scissors v1.0 BETA by Rejack
Reply With Quote #11

Quote:
Originally Posted by Kia View Post
You said now

So bad code is one of three reasons.
In fact there is more reasons but as i said, that doesnt cares for what we talking about. If plugin is bad coded it cant be approved.

And sorry for this off-topic
__________________
Jhob94 is offline
darcadarca
Senior Member
Join Date: Feb 2012
Location: Romania
Old 07-11-2013 , 00:34   Re: Rock Paper Scissors v1.0 BETA by Rejack
Reply With Quote #12

Quote:
Originally Posted by yan1255 View Post
What do you mean?
how will that go exactly?
make it on points , when you win a game .. or just with top10

Quote:
Originally Posted by Kia View Post
For what? Want to have Asteroid instead of stone?
not really but is so simple
__________________
hqqqqqqqq

Last edited by darcadarca; 07-11-2013 at 00:35.
darcadarca is offline
Send a message via Yahoo to darcadarca
Old 07-12-2013, 16:33
Kiske
This message has been deleted by Kiske.
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 07-15-2013 , 20:35   Re: Rock Paper Scissors v1.0 BETA by Rejack
Reply With Quote #13

Yeah, but this plugin is not badly coded, so just get over that fact. If you want to start a discussion on whether a plugin should or shouldn't be approved based on the code quality, create a thread in the Offtopic section.
Backstabnoob is offline
lobopack23
Senior Member
Join Date: Jun 2009
Location: California , United Stat
Old 08-08-2013 , 19:54   Re: Rock Paper Scissors v1.0 BETA by Rejack
Reply With Quote #14

Code:
#include <amxmodx>
#include <cstrike>

new gReqMoney
new gReward

 public plugin_init()
 {
    register_plugin("Rock, Paper, Scissors", "1.0", "hib")
    register_clcmd( "say /rps", "RockPaperScissorsMenu" )
    register_clcmd( "say_team /rps", "RockPaperScissorsMenu" )

    gReqMoney = register_cvar("amx_rps_reqmoney", "300")
    gReward = register_cvar("amx_rps_reward", "600")
 }

 public RockPaperScissorsMenu(id)
 {
    new onhandmoney = cs_get_user_money(id)

    if ( onhandmoney < get_pcvar_num(gReqMoney) )
        return PLUGIN_CONTINUE

    cs_set_user_money(id, onhandmoney - get_pcvar_num(gReward))
    new menu = menu_create("\rChoose an option:", "RockPaperScissors_Select")
    
    menu_additem(menu,"Rock", "1", 0)
    menu_additem(menu,"Paper", "2", 0)
    menu_additem(menu,"Scissors", "3", 0)
    
    menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
    
    menu_display(id, menu, 0)
    return PLUGIN_HANDLED
 }

 public RockPaperScissors_Select(id, menu, item)
 {
    new onhandmoney = cs_get_user_money(id)

    // While they select, lets also give the computer a random number
    new computerPlay = random(3) // Random Generated number

    if (item == MENU_EXIT)
    {
        menu_destroy(menu)
        return PLUGIN_HANDLED
    }
    new data[6], iName[64]
    new acces, callback
    menu_item_getinfo(menu, item, acces, data,5, iName, 63, callback)
    
    new key = str_to_num(data)
    
    switch(key)
    { 
        case 1:    // ROCK
        {
            new personPlay = 1;
            
            if (personPlay == computerPlay)
            {
                client_print(id, print_chat, "computerPlay = %d", computerPlay)
                client_print(id, print_chat, "It's a tie!")
            }

            else if (computerPlay == 3)
            {
                client_print(id, print_chat, "computerPlay = %d", computerPlay)
                client_print(id, print_chat, "Rock crushes scissors.");
                client_print(id, print_chat, "You've won $%d", get_pcvar_num(gReward))
                cs_set_user_money(id, onhandmoney + get_pcvar_num(gReward))
            }
            else if (computerPlay == 2)
            {
                client_print(id, print_chat, "computerPlay = %d", computerPlay)
                client_print(id, print_chat, "Paper catches rock. You Lose!!");
            }
        }
        case 2:    // PAPER
        {
            new personPlay = 2;

            if (personPlay == computerPlay)
            {
                client_print(id, print_chat, "computerPlay = %d", computerPlay)
                client_print(id, print_chat, "It's a tie!")
            }

            else if (computerPlay == 1)
            {
                client_print(id, print_chat, "computerPlay = %d", computerPlay)
                client_print(id, print_chat, "Paper catches rock.");
                client_print(id, print_chat, "You've won $%d", get_pcvar_num(gReward))
                cs_set_user_money(id, onhandmoney + get_pcvar_num(gReward))
            }
            else if (computerPlay == 3)
            {
                client_print(id, print_chat, "computerPlay = %d", computerPlay)
                client_print(id, print_chat, "Scissors cuts paper. You Lose!!");
            }
            
        }
            
        case 3:    // SCISSORS
        {
            new personPlay = 3;

            if (personPlay == computerPlay)
            {
                client_print(id, print_chat, "computerPlay = %d", computerPlay)
                client_print(id, print_chat, "It's a tie!")
            }

            else if (computerPlay == 2)
            {
                client_print(id, print_chat, "computerPlay = %d", computerPlay)
                client_print(id, print_chat, "Scissors cuts paper.");
                client_print(id, print_chat, "You've won $%d", get_pcvar_num(gReward))
                cs_set_user_money(id, onhandmoney + get_pcvar_num(gReward))
            }
            else if (computerPlay == 3)
            {
                client_print(id, print_chat, "computerPlay = %d", computerPlay)
                client_print(id, print_chat, "Rock crushes scissors. You Lose!!");
            }
        }
    }

    menu_destroy(menu)
    return PLUGIN_HANDLED
 }
Here is a menu version of RPS.
- Play versus the computer
- Has Required Money Check to play as well as Bonus after you win.
__________________
- Steam: Lobopack23 - Link
Contact me if you need any help with Pokemod.
- 2nd Generation Pokemod - Link
(new skills, items, and pokemons)
- Buy Xp - Link

Last edited by lobopack23; 08-08-2013 at 19:55.
lobopack23 is offline
Reply



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

Forum Jump


All times are GMT -4. The time now is 05:56.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode