Raised This Month: $ Target: $400
 0% 

[HELP] - Every Round


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Yusochan
Member
Join Date: Sep 2021
Location: Algeria
Old 11-03-2021 , 19:16   [HELP] - Every Round
Reply With Quote #1

Hello !

I wanna the part of script that set something every round

Like a
PHP Code:
 set_task 
I have a plugin that gives a bonus and idk how to set it each new round. and if u want the script here is it :
Code:
#include <amxmodx>
#include <cstrike>
#include <fun>
#include <hamsandwich>
#include <cromchat>

//PS : I know my code is shitty so please don't remind me about it :)

new g_pPrefix;

public plugin_init() {
	register_plugin("Steam Bonus", "2.0", "YusoChan-");
	
	RegisterHam(Ham_Spawn, "player", "PlayerPostSpawn", 1);
	
	CC_SetPrefix("&x01[&x04FURIEN.NPOWERED.RO&x01]");
}

public client_putinserver(id) 
{
	set_task(1.0, "GIVE", id) 
}

public GIVE(id) 
{
	if(is_user_alive(id) || !is_user_steam(id)) {
		return PLUGIN_HANDLED;
	}	
	new name[33]
	get_user_name( id, name, 32 )
	set_user_health(id, get_user_health(id) + 25);
	cs_set_user_money(id, cs_get_user_money(id) + 2500);
	set_user_armor(id, get_user_armor(id) + 25);
	//Message:
	CC_SendMessage(id, "%s &x01Dear: &x04%s &x03You have got &x042500&x01$/&x0425&x01HP/&x0425&x01AP/", g_pPrefix, name);
	return 0;
}

stock bool:is_user_steam(id)
{
	static dp_pointer
	if(dp_pointer || (dp_pointer = get_cvar_pointer("dp_r_id_provider")))
	{
		server_cmd("dp_clientinfo %d", id)
		server_exec()
		return (get_pcvar_num(dp_pointer) == 2) ? true : false
	}
	return false
}
__________________
<b>IP : <font color=Red>93.115.53.168:27017</font></b>
<b>Founder : <font color=Cyan>YusoChan-</font></b>
Yusochan is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 11-03-2021 , 19:37   Re: [HELP] - Every Round
Reply With Quote #2

Here's on how to catch every new round/round start/round end/player spawn: https://forums.alliedmods.net/showthread.php?t=42159

Just use new round or round start instead of player spawn. Allthough player spawn works as good.

PS: Use charsmax() instead of hardcoding array sizes.

PHP Code:
new szName[32];
get_user_name(idszNamecharsmax(szName)); // Same as : get_user_name(id, szName, 31); 
__________________

Last edited by Napoleon_be; 11-03-2021 at 19:40.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Yusochan
Member
Join Date: Sep 2021
Location: Algeria
Old 11-04-2021 , 07:42   Re: [HELP] - Every Round
Reply With Quote #3

Quote:
Originally Posted by Napoleon_be View Post
Here's on how to catch every new round/round start/round end/player spawn: https://forums.alliedmods.net/showthread.php?t=42159

Just use new round or round start instead of player spawn. Allthough player spawn works as good.

PS: Use charsmax() instead of hardcoding array sizes.

PHP Code:
new szName[32];
get_user_name(idszNamecharsmax(szName)); // Same as : get_user_name(id, szName, 31); 
Thanks sir ! u are always here to help me
__________________
<b>IP : <font color=Red>93.115.53.168:27017</font></b>
<b>Founder : <font color=Cyan>YusoChan-</font></b>
Yusochan 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 11:37.


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