Raised This Month: $ Target: $400
 0% 

[SOLVED]Variable for every player [Help]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-02-2010 , 20:56   Re: Variable for every player [Help]
Reply With Quote #1

Use an array dimensioned with 33 and use it with id as the index.
__________________
fysiks is offline
Callesson
Member
Join Date: Jan 2010
Old 12-02-2010 , 21:00   Re: Variable for every player [Help]
Reply With Quote #2

Like this?
Code:
new warning[33] = 0

public kick(id)
{
    if(warning[id] == 0)
    {
        client_print(id, print_chat,"[Whatch your lang] Warning: 1/3")
        
        warning[id]++
    }
    else if(warning[id] == 1)
    {
        client_print(id, print_chat,"[Whatch your lang] Warning: 2/3")
        warning[id]++
    }
    else if(warning[id] == 2)
    {
        client_print(id, print_chat,"[Whatch your lang] Warning: 3/3 Next time you will get kicked")
        warning[id]++
    }
    else if(warning[id]== 3)
    {
        client_cmd(id,"echo Kicked from server! Next time please mind you language or end up with a ban!")
        client_cmd(id,"disconnect")
        warning[id]++
    }
    else if(warning[id]== 4)
    {
        client_print(id, print_chat,"[Whatch your lang] BANNED!")
        warning[id]= 0
    }
}
__________________

Last edited by Callesson; 12-02-2010 at 21:00. Reason: Miss
Callesson is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-02-2010 , 21:13   Re: Variable for every player [Help]
Reply With Quote #3

Yes. However, you can optimize it with a switch

Code:
switch(warning[id])
{
	case 0:
	{
		// stuff
	}
	case 1:
	{
		// stuff
	}
}
__________________
fysiks 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 11:23.


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