Raised This Month: $ Target: $400
 0% 

how to make a plugin run once for a client which connects to the server.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Erox902
Veteran Member
Join Date: Jun 2009
Location: Never Never Land
Old 01-02-2012 , 12:28   Re: how to make a plugin run once for a client which connects to the server.
Reply With Quote #1

PHP Code:
if(GiftUsed[id] == true) { 
        return 
PLUGIN_HANDLED 
--->
PHP Code:
if(GiftUsed[id] || !is_user_alive(id)) { 
        return 
PLUGIN_HANDLED 
If you're using bools you don't need to check with == ( if you don't absolutely prefer it that way ofc ),
Just "if ( bool )" for true or "if ( !bool )" for false.
( Also works for variables if you wanna check if it is zeroed, "!" )

And in the spawn function there should always be an alive check,
the spawn function gets called once on connect aswell, so in this case...
the bool will be true before he spawns for the first time.
Erox902 is offline
Ex1ne
Senior Member
Join Date: Oct 2011
Location: Norway
Old 01-05-2012 , 06:08   Re: how to make a plugin run once for a client which connects to the server.
Reply With Quote #2

Quote:
Originally Posted by Erox902 View Post
PHP Code:
if(GiftUsed[id] == true) { 
        return 
PLUGIN_HANDLED 
--->
PHP Code:
if(GiftUsed[id] || !is_user_alive(id)) { 
        return 
PLUGIN_HANDLED 
*facepalm*
PHP Code:
    RegisterHam(Ham_Spawn"player""Spawn"1
It triggers by spawning, why check if he's alive? *facepalm again*
__________________
Ex1ne 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 12:09.


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