Raised This Month: $ Target: $400
 0% 

Why its not working


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KillhemAll
Member
Join Date: Jun 2008
Old 10-20-2008 , 10:32   Why its not working
Reply With Quote #1

Hello guys again a thing which dont work why?

PHP Code:
 public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say /checkalladmin","checkifadmin")
    
register_clcmd("checkalladmin","checkifadmin")
    
SayText get_user_msgid("SayText");
}


 public 
checkifadmin(id)
 {
     
console_print(id,"You Name was Changed .")
    
_colcor_chat(id,"[Open-Zone.de]^x01Checked all Admins")
    if(!
is_user_admin(id))
    {
        return 
PLUGIN_HANDLED
    
}
    else 
    {
        new 
UsersName[32
        
get_user_name(id,UsersName,32)
        
set_user_info(id"Admin | %s"UsersName)
    }
    if(
is_user_admin(id))
    {
        new 
UsersName[32
        
get_user_name(id,UsersName,32)
        
set_user_info(id"Admin | %s"UsersName)
    }
    else 
    {
        return 
PLUGIN_HANDLED
    
}

It just doesnt call...

Plz help
__________________

KillhemAll is offline
minimiller
Veteran Member
Join Date: Aug 2007
Location: United Kingdom
Old 10-20-2008 , 10:54   Re: Why its not working
Reply With Quote #2

This means if the user is not admin:
Code:
if(!is_user_admin(id))
    {
        return PLUGIN_HANDLED
    }

This means user is admin:
Code:
else

so u dont need this bit:
Code:
if(is_user_admin(id))
    {
        new UsersName[32] 
        get_user_name(id,UsersName,32)
        set_user_info(id, "Admin | %s", UsersName)
    }
    else 
    {
        return PLUGIN_HANDLED
    }


I also dont think this will do anything:
Code:
_colcor_chat(id,"[Open-Zone.de]^x01Checked all Admins")
__________________
minimiller is offline
Send a message via MSN to minimiller
KillhemAll
Member
Join Date: Jun 2008
Old 10-20-2008 , 13:23   Re: Why its not working
Reply With Quote #3

Yes this is a stock i've implemented later.
__________________

KillhemAll is offline
KillhemAll
Member
Join Date: Jun 2008
Old 10-20-2008 , 13:24   Re: Why its not working
Reply With Quote #4

Yes this is a stock i've implemented later.

One question :

Why i get in my compiler "Loose intendation" whats this?
__________________

KillhemAll is offline
minimiller
Veteran Member
Join Date: Aug 2007
Location: United Kingdom
Old 10-20-2008 , 13:28   Re: Why its not working
Reply With Quote #5

to get rid of that error use:
Quote:
extras > indent code

And also, u might wanna show us ur whole code if u want help
__________________
minimiller is offline
Send a message via MSN to minimiller
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 10-20-2008 , 14:37   Re: Why its not working
Reply With Quote #6

Quote:
Originally Posted by KillhemAll View Post
Yes this is a stock i've implemented later.

One question :

Why i get in my compiler "Loose intendation" whats this?
its when you use to much ore to less tabs (ore spaces)
like this

PHP Code:
public code()
{
    if(
is_user_alive(id))
    {
          if(
idunno[id])
    {
          
/* got error */
    
}

__________________
I am out of order!
grimvh2 is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 10-21-2008 , 08:27   Re: Why its not working
Reply With Quote #7

Or the lines are not in the same order..
__________________

anakin_cstrike is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 10-21-2008 , 08:55   Re: Why its not working
Reply With Quote #8

add to grim, without error, it will look
PHP Code:
public code()
{
    if(
is_user_alive(id))
    {
        if(
idunno[id])
        {
            
/* no error */
        
}
    }

__________________
xPaw 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 02:02.


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