AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   REQ automatic revive VIP (https://forums.alliedmods.net/showthread.php?t=322385)

mousesports 03-25-2020 14:47

REQ automatic revive VIP
 
Good evening,
I need a plugin, which will give automatically, but with a 0.5% chance to revive the vip when they are killed. With this plugin I have attached, those with vip can write / revive. Please change it to automatic revive with random spawn, with a 0.5% chance if you can. Thank you !



PHP Code:

#include <amxmodx>
#include <hamsandwich>

static const
PLUGIN[] = "",
VERSION[] = "1.0",
AUTHOR[] = "scosmyn";

new 
count[33] = 0

public plugin_init() {
register_plugin(PLUGIN,VERSION,AUTHOR);

register_clcmd("say /revive","cmdRevive")

register_logevent("round_start",2,"1=Round_Start");
}

public 
round_start( ) {
static 
i
for(1<= get_maxplayers(); i++)
count 0
}

public 
cmdRevive(id) {
if(
count[id] == 3)
{
color(id,"!team[V.I.P REVIVE] !yAi folosit deja de 3 ori !grevive !yrunda viitoare poti accesa dinou!")
return 
1
}
if(
is_user_alive(id))
return 
1

if(!(get_user_flags(id) & ADMIN_LEVEL_H))
{
color(id,"!team[V.I.P REVIVE] !yNu ai acces la /revive , doar !gV.I.P-ul !yare acces!")
return 
1
}

count[id]++

ExecuteHam(Ham_CS_RoundRespawn,id)
return 
0
}

stock color( const id, const input[ ], any:... )
{
new 
count 1players32 ]

static 
msg191 ]
vformatmsg190input)

replace_allmsg190"!g""^4" //- verde
replace_allmsg190"!y""^1" //- galben
replace_allmsg190"!team""^3" //- echipa
replace_allmsg190"!n""^0" //- normal

if( id players] = id; else get_playersplayerscount"ch" )
{
for( new 
0counti++ )
{
if( 
is_user_connectedplayers] ) )
{
message_beginMSG_ONE_UNRELIABLEget_user_msgid"SayText" ), _players] )
write_byteplayers] );
write_stringmsg );
message_end( );
}
}
}



Xalus 03-26-2020 06:54

Re: REQ automatic revive VIP
 
PHP Code:

#include <amxmodx>
#include <hamsandwich>

public plugin_init()
{
  
RegisterHam(Ham_Killed"player""hamplayer_killed_post"1)
}

public 
hamplayer_killed_post(client)
{
  if(
is_user_connected(client)
    && 
get_user_flags(client) & ADMIN_LEVEL_H
    
&& random(200) == 1)
  {
    
ExecuteHam(Ham_CS_RoundRespawnclient)
  }



mousesports 03-26-2020 07:18

Re: REQ automatic revive VIP
 
Can you please integrate it ? And there its a chance of resurect 0.5 % or 1 % >? I dont want resurect all the time .. I need a lotery with a chance . Thank you !

OciXCrom 03-26-2020 07:58

Re: REQ automatic revive VIP
 
He already did. The "random(200)" part of the code is 0.5% chance.

mousesports 03-26-2020 08:16

Re: REQ automatic revive VIP
 
Quote:

Originally Posted by OciXCrom (Post 2688600)
He already did. The "random(200)" part of the code is 0.5% chance.

Thank you ! I dont know how to integrate that code , just copy and pase on the first part of plugin ? Can you please do it for me ? thank you !

Xalus 03-26-2020 08:20

Re: REQ automatic revive VIP
 
So you want the /revive command to exist to?

mousesports 03-26-2020 08:24

Re: REQ automatic revive VIP
 
I don't know if I was explicit enough. I want this plugin to automatically use the revive command for those who have a vip flag, but with a 0.5% chance without them writing / reviving. When that revive is received, he will be randomly placed on the map with the weapon he had before he died. The respective chance of 0.5% being active, if there are at least 2 players alive in the team of which that VIP is part.

mousesports 03-26-2020 08:26

Re: REQ automatic revive VIP
 
Quote:

Originally Posted by Xalus (Post 2688611)
So you want the /revive command to exist to?

No , i dont want that command . I posted that plugin to make it easier to edit for those who want to help me. I don't understand and I don't know if this will help or make it difficult for you.

OciXCrom 03-26-2020 08:32

Re: REQ automatic revive VIP
 
Then simply use his plugin. That's the entire code that's needed. No need to integrate anything.

mousesports 03-26-2020 08:42

Re: REQ automatic revive VIP
 
Quote:

Originally Posted by OciXCrom (Post 2688615)
Then simply use his plugin. That's the entire code that's needed. No need to integrate anything.

#include <amxmodx>
#include <hamsandwich>

public plugin_init()
{
RegisterHam(Ham_Killed, "player", "hamplayer_killed_post", 1)
}

public hamplayer_killed_post(client)
{
if(is_user_connected(client)
&& get_user_flags(client) & ADMIN_LEVEL_H
&& random(200) == 1)
{
ExecuteHam(Ham_CS_RoundRespawn, client)
}
}

this its all i need? That plugin have /revive comand so i dont need .... You dont understand me ..


All times are GMT -4. The time now is 15:25.

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