Raised This Month: $ Target: $400
 0% 

Random Respawn Chance


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
LifeStone
Member
Join Date: Oct 2015
Old 03-29-2017 , 04:16   Random Respawn Chance
Reply With Quote #1

Hello guys i want to make this plugin to give chance once per round and not with the time
(example: if i write /reviveme me and command used say "Try again in x seconds.")
and i want to make it to give one chance per round
and something else i want to make it to give more chance to admins
(example: admins 15% chance players 10% chance)
like this
PHP Code:
        register_cvar("spawnchance_odds","100")

        new 
ChanceAmount random(get_cvar_num("spawnchance_odds")) 

        if (
get_user_flags(id) & ADMIN_IMMUNITY
        { 
            if (
ChanceAmount <= 15
            { 
                
client_print(id,print_chat"You win! Prepare to be respawned!"
            } 
            else if (
ChanceAmount 15
            { 
                
client_print(id,print_chat"Sorry, you didn't respawn this time!"
            } 
        } 
        else 
        { 
            if (
ChanceAmount <= 10
            { 
                
client_print(id,print_chat"You win! Prepare to be respawned!"
            } 
            else if (
ChanceAmount 10
            { 
                
client_print(id,print_chat"Sorry, you didn't respawn this time!"
            } 
        } 
Attached Files
File Type: sma Get Plugin or Get Source (respawnchance.sma - 458 views - 8.9 KB)

Last edited by LifeStone; 04-01-2017 at 12:23.
LifeStone is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 03-29-2017 , 13:22   Re: Random Respawn Chance
Reply With Quote #2

Use an array with [33] size and get_systime().

PHP Code:
new iSysTime get_systime()
if(
iSysTime >= YourArray[id])
{
    
YourArray[id] = iSysTime yourdelay
}
else
{
    
client_print(idprint_chat"Wait %i second%s", (YourArray[id] - iSysTime), (YourArray[id] - iSysTime) > "s" "")

For set a chance, use random_num().

PHP Code:
new iRandom random_num(firstValue, (get_user_flags(id) & ADMIN_BAN) ? secondValueAdmin secondValueNormalPlayer)
if(
iRandom == ValueYouWant)
{
    
// bla bla

__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 03-29-2017 at 13:26.
EFFx is offline
LifeStone
Member
Join Date: Oct 2015
Old 03-30-2017 , 12:34   Re: Random Respawn Chance
Reply With Quote #3

someone can help me ?

Last edited by LifeStone; 04-01-2017 at 12:23.
LifeStone is offline
LifeStone
Member
Join Date: Oct 2015
Old 03-31-2017 , 07:58   Re: Random Respawn Chance
Reply With Quote #4

someone can help me ? sry double post :/

Last edited by LifeStone; 04-01-2017 at 12:30.
LifeStone is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 04-01-2017 , 15:00   Re: Random Respawn Chance
Reply With Quote #5

here's respawn by chance each round...
Attached Files
File Type: sma Get Plugin or Get Source (respawnbychance.sma - 550 views - 5.2 KB)
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 04-01-2017 at 16:04.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
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 17:59.


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