Raised This Month: $ Target: $400
 0% 

Touch entity trigger_once doesn't work.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
wicked95
Member
Join Date: Dec 2012
Old 07-29-2013 , 05:54   Touch entity trigger_once doesn't work.
Reply With Quote #1

The code:
PHP Code:
public plugin_init() {
     
register_touch("trigger_once""player""FwdPlayerTouchTriggerOnce");
}
 
public 
FwdPlayerTouchTriggerOnce(entid)
{
    if(
is_user_alive(id))
    {
        return 
PLUGIN_HANDLED;
    }
     new 
PlayerName[32]
     static 
targetName[32]
     static 
msg[100]
     
get_user_name(idPlayerName31)
     
entity_get_string(entityEV_SZ_targetnametargetNamecharsmax(targetName));
     if(
equal(targetName"finishline"))
     {
          
format(msg,99,"^x04%s finished the map."PlayerName);
          
client_color(0,1,msg);
          
HasLife[id] = false;
          
user_kill(id);
     }
     return 
PLUGIN_HANDLED;
}
 
public 
client_color(playeridcoloridmsg[])
{
     
message_begin((playerid== 0) ? MSG_ALL MSG_ONE,gmsgSayText,_,playerid
     
write_byte(colorid)
     
write_string(msg)
     
message_end()

When i searched i found only this http://forums.alliedmods.net/showthread.php?p=1723370 . I've modified the code many times but no effect. I can't uderstand whats wrong with it. I created a map with an object trigger_once at the end of it with a name "finishline". It doesn't give any errors but it doesn't work too.

Last edited by wicked95; 07-29-2013 at 05:55.
wicked95 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 15:45.


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