Raised This Month: $ Target: $400
 0% 

How to use get_players?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
byetovice
Senior Member
Join Date: Nov 2009
Location: Turkey
Old 11-27-2009 , 03:00   How to use get_players?
Reply With Quote #1

how can i use get_players?i get this error "invalid player x"

code :
Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <hamsandwich>
#include <cstrike>
#include <fakemeta>
#include <engine>
#define PLUGIN "Heal on See"
#define VERSION "1.0"
#define AUTHOR "author"

public plugin_init() {
 register_plugin(PLUGIN, VERSION, AUTHOR)
 RegisterHam(Ham_Spawn,"player","FwdHamPlayerSpawn",1);
 
}
public FwdHamPlayerSpawn(id)
{
set_task(1.0,"healonsee",id,"",0,"b")
}
public healonsee(id)
{
new players[32],num;
get_players(players,num)
new i;
for(i=0;i<num;i++)
{
if(num!=0)
{
if(is_user_alive(players[i]))
{
new origin1[3],origin2[3];
get_user_origin(id,origin1,0)
get_user_origin(players[i],origin2,0)
new distance = get_distance(origin1,origin2)
if(distance <=40.0)
{
set_user_health(id,get_user_health(id)+1)
}
}
}
}
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg1254\\ deff0\\ deflang1055{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ f0\\ fs16 \n\\ par }
*/
what's wrong? please helpme
byetovice is offline
 


Thread Tools
Display Modes

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 13:41.


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