View Single Post
mlibre
Veteran Member
Join Date: Nov 2015
Location: return PLUGIN_CONTINUE
Old 04-14-2024 , 09:01   Re: Update user money
Reply With Quote #3

Quote:
Originally Posted by tedaimlocks View Post
solved. for anyone who needs the plugin :

wtf
hi, I guess you're you are trying to restore the money to the player "only" when he connects to the server, this would be done once therefore it is not necessary to create an infinite loop since it recreates an overload to the server and more if it is a zp

for them we can make sure that the player has entered and chosen a team, and then give them the money.

It will be enough, try...

Code:
#include <amxmodx> #include <hamsandwich> #include <cstrike> #include <zp_buymenu> #if AMXX_VERSION_NUM > 182     #define client_disconnect client_disconnected #else     #define MAX_PLAYERS 32 #endif new bool:is_spawn[MAX_PLAYERS + 1] public plugin_precache() {     RegisterHam(Ham_Spawn, "player", "Ham_SpawnPlayer_Post", true) } public Ham_SpawnPlayer_Post(id) {     if( !is_spawn[id] && is_user_alive(id) )     {         is_spawn[id] = true                 cs_set_user_money(id, zp_cs_get_user_money(id))     } } public client_putinserver(id) {     if(is_user_bot(id))     {         is_spawn[id] = true     } } public client_disconnect(id) {     if(is_spawn[id])     {         is_spawn[id] = false     } }
__________________
mlibre is offline