Raised This Month: $ Target: $400
 0% 

Logs Errors


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
simanovich
AlliedModders Donor
Join Date: Jun 2012
Location: Israel
Old 11-29-2014 , 05:27   Re: Logs Errors
Reply With Quote #2

PHP Code:
public plugin_init(){
    
// ...
    
RegisterHam(Ham_Spawn,"player","spawnc",1); // Post method - Called after a client spawns
    // ...
}

public 
spawnc(id){
    if (!
is_user_alive(id)) // Double check
        
return;

    
set_task(1.0"ProveriMe"id)

    if(
hpr[id])
        
set_user_gravity(idget_user_gravity(id) - 0.3);

    if(
smoke[id])
    {
        
cs_set_weapon_ammo(give_item(id"weapon_glock18"),1);
        
cs_set_user_bpammo(id,CSW_GLOCK18,);
    }

    else if(
glock[id])
    {
        
cs_set_weapon_ammo(give_item(id,"weapon_glock18"),1);
        
cs_set_user_bpammo(id,CSW_GLOCK18,0);
    }

Don't use find_ent_by_owner as the give_item native returns the item entity index.
Don't use pre method when you need post method.
__________________
simanovich 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 17:42.


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