Raised This Month: $ Target: $400
 0% 

Set negative frag/score


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Rirre
Veteran Member
Join Date: Nov 2006
Old 02-01-2013 , 08:59   Set negative frag/score
Reply With Quote #1

Setting negative score/frag to the player just won't work with either set_user_frags or Ham_AddPoints way.

Doing it with Ham_AddPoints sets the player's score back to 0 (using a plugin which force the score to not go to a negative value), doesn't matter how high score the player had. And without checking the user frags, it crash the server instantly when the event gets called.
Code:
#include <amxmodx> #include <fun> #include <hamsandwich> new g_maxplayers #define IsPlayer(%1) (1 <= %1 <= g_maxplayers) public plugin_init() {     register_event("TextMsg", "HookHostageKilled", "b", "2&#Killed_Hostage")     g_maxplayers = get_maxplayers() } public HookHostageKilled(id) {     if(IsPlayer(id))     { //      ExecuteHamB(Ham_AddPoints, id, -2, true) // server crash instantly         // The killer/player's score is set to 0 even if the killer/player have 2+ score         if(get_user_frags(id) >= 2)             ExecuteHamB(Ham_AddPoints, id, -2, true)         else if(get_user_frags(id) == 1)             ExecuteHamB(Ham_AddPoints, id, -1, true)     } }

Last edited by Rirre; 02-01-2013 at 16:15.
Rirre is offline
 



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 20:38.


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