Raised This Month: $ Target: $400
 0% 

whats wrong with conditions


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
avril-lavigne
Banned
Join Date: Apr 2009
Old 08-14-2012 , 08:30   whats wrong with conditions
Reply With Quote #1

PHP Code:
public fwdPlayerSpawn(id)
{
     if(!
is_user_alive(id) && (!is_user_admin(id)))
     return 
PLUGIN_CONTINUE

     ShowAdminMenu
(id
     
set_user_footsteps(id1)
    
//set_user_frags(id,get_user_frags(id) + 1)
     
     
return PLUGIN_CONTINUE

I have is logs [FUN] invalid player id ( native set_user_footsteps )

but plugin is working fine
__________________
VDS in Europe 1 gb/s unmetered.Any configurations.
I accept Paypal, Moneybookers,etc
avril-lavigne is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-14-2012 , 09:30   Re: whats wrong with conditions
Reply With Quote #2

Quote:
Originally Posted by avril-lavigne View Post
PHP Code:
public fwdPlayerSpawn(id)
{
     if(!
is_user_alive(id) && (!is_user_admin(id)))
     return 
PLUGIN_CONTINUE 
This will work for:
- all alive players
- all dead non-admins

This won't work for:
- dead admins

This will break on players that aren't connected yet.

Change && to ||
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 08-14-2012 , 11:03   Re: whats wrong with conditions
Reply With Quote #3

I believe you hook spawn with ham, so use its' own returns. Also, you could change it easy to this ->

PHP Code:
public fwdPlayerSpawn(id

     if(
is_user_alive(id) && is_user_admin(id)) 
     {
          
ShowAdminMenu(id)  
          
set_user_footsteps(id1
          
//set_user_frags(id,get_user_frags(id) + 1) 
     
}

__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
avril-lavigne
Banned
Join Date: Apr 2009
Old 08-14-2012 , 11:36   Re: whats wrong with conditions
Reply With Quote #4

thanks bibu
__________________
VDS in Europe 1 gb/s unmetered.Any configurations.
I accept Paypal, Moneybookers,etc
avril-lavigne 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 05:51.


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