Raised This Month: $51 Target: $400
 12% 

[Help] Respawns in VIP Menu!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ITGurra
Junior Member
Join Date: Nov 2015
Old 11-24-2015 , 08:57   [Help] Respawns in VIP Menu!
Reply With Quote #1

Hello all users on AlliedMods Forums!

I need some help with a vip plugin i am currently making.

I have this respawn feature and i would like all users to be able to respawn 3 times / map on my Jail CSGO Server. But right now all VIP's are sharing 3 respawns and it is does not reset respawns after map change.

I need help with:
  • Allow vip users to have 3 respawns each.
  • Reset respawns when mapchange!

Sorry for my bad English, i am from Sweden.
This is my first plugin I ever made so I would appreciate help to make it all work!
any questions just reply to this topic!

Thanks!


Last edited by ITGurra; 11-24-2015 at 11:59.
ITGurra is offline
VsX
AlliedModders Donor
Join Date: Jul 2007
Old 11-24-2015 , 10:01   Re: [Help] Respawns in VIP Menu!
Reply With Quote #2

Just make variable g_spawn[MAXPLAYERS+1] and set it to 3 if player flags are vip flags.
Hook player_death, decrement g_spawn[client] value and respawn client.
VsX is offline
ITGurra
Junior Member
Join Date: Nov 2015
Old 11-24-2015 , 10:32   Re: [Help] Respawns in VIP Menu!
Reply With Quote #3

Quote:
Originally Posted by VsX View Post
Just make variable g_spawn[MAXPLAYERS+1] and set it to 3 if player flags are vip flags.
Hook player_death, decrement g_spawn[client] value and respawn client.
Do you think you can edit the things and post?
Since i think it's hard to understand x)
ITGurra is offline
VsX
AlliedModders Donor
Join Date: Jul 2007
Old 11-24-2015 , 10:58   Re: [Help] Respawns in VIP Menu!
Reply With Quote #4

You want to respawn player automatically (on player death) or via command?
VsX is offline
ITGurra
Junior Member
Join Date: Nov 2015
Old 11-24-2015 , 11:21   Re: [Help] Respawns in VIP Menu!
Reply With Quote #5

Quote:
Originally Posted by VsX View Post
You want to respawn player automatically (on player death) or via command?
Via the command i have coded, !vipres

The problem is that all vip's are sharing on 3 respawns totaly, not each. And the respawns is not resseting after mapchange.
ITGurra is offline
VsX
AlliedModders Donor
Join Date: Jul 2007
Old 11-24-2015 , 11:36   Re: [Help] Respawns in VIP Menu!
Reply With Quote #6

Code:
new g_PlayerRespawn[MAXPLAYERS+1];

public bool:OnClientConnect(client, String:Reject[], Len)
{

    if (IsPlayerGenericAdmin(client))
      g_PlayerRespawn[client] = 3
    else 
      g_PlayerRespawn[client] = 0;

}  

public Action:VipRespawn(client, args)
{
	if (IsPlayerGenericAdmin(client))
    {
			if (g_PlayerRespawn[client] > 0)
			{
				CS_RespawnPlayer(client);
				g_PlayerRespawn[client]--;
			}
			else
			{
				PrintToChat(client, "You have no respawns left.");
			}
		}
    }

Last edited by VsX; 11-24-2015 at 11:43.
VsX is offline
ITGurra
Junior Member
Join Date: Nov 2015
Old 11-24-2015 , 11:59   Re: [Help] Respawns in VIP Menu!
Reply With Quote #7

Quote:
Originally Posted by VsX View Post
Code:
new g_PlayerRespawn[MAXPLAYERS+1];

public bool:OnClientConnect(client, String:Reject[], Len)
{

    if (IsPlayerGenericAdmin(client))
      g_PlayerRespawn[client] = 3
    else 
      g_PlayerRespawn[client] = 0;

}  

public Action:VipRespawn(client, args)
{
	if (IsPlayerGenericAdmin(client))
    {
			if (g_PlayerRespawn[client] > 0)
			{
				CS_RespawnPlayer(client);
				g_PlayerRespawn[client]--;
			}
			else
			{
				PrintToChat(client, "You have no respawns left.");
			}
		}
    }
Thanks!!
ITGurra is offline
VsX
AlliedModders Donor
Join Date: Jul 2007
Old 11-24-2015 , 12:00   Re: [Help] Respawns in VIP Menu!
Reply With Quote #8

let me know is it working.
VsX is offline
ITGurra
Junior Member
Join Date: Nov 2015
Old 11-24-2015 , 12:16   Re: [Help] Respawns in VIP Menu!
Reply With Quote #9

Quote:
Originally Posted by VsX View Post
let me know is it working.
Everytime i try to connect it's just,
Disconnect: Connection rejected by game.

Plugin is causing server to crash :/

Last edited by ITGurra; 11-24-2015 at 12:25. Reason: Update!
ITGurra is offline
VsX
AlliedModders Donor
Join Date: Jul 2007
Old 11-24-2015 , 12:29   Re: [Help] Respawns in VIP Menu!
Reply With Quote #10

can You show me Your code?
VsX 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 07:48.


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