Raised This Month: $ Target: $400
 0% 

Multiple Triggers on pTouched


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
blood2k
Senior Member
Join Date: Mar 2014
Old 03-28-2017 , 01:45   Multiple Triggers on pTouched
Reply With Quote #1

Alright, I'm in no way a coder.. but I've been reading around and putting together snippets of codes that are relevant to what I needed to do: Create a entity sprite that when players step on will show them a message/motd/or whatever... i'll figure this out eventually.

Now I have it all put together.. and I was testing it showing a message to the player that touches the entity. It shows "Test test test".. my problem is it keeps spamming it as long as the player stands near the entity.. could somebody help me make it only execute the message once.. until player walks away and comes back to it again.

Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <engine>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

 public plugin_precache()
{
precache_model("sprites/marker.spr") 
}
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_touch("info_ammustore", "player", "Message") 
static ent
ent  = create_entity("info_target")
if(ent)
{
entity_set_string(ent,EV_SZ_classname,"info_ammustore") // entity classname
entity_set_model(ent,"sprites/marker.spr") // path to the sprite
 
entity_set_int(ent, EV_INT_solid, SOLID_TRIGGER) // Solid Passable
entity_set_int(ent,EV_INT_movetype,MOVETYPE_NONE) // don't move
 
set_rendering(ent, kRenderFxNoDissipation, 0,0,0, kRenderGlow, 255) 
 
entity_set_origin(ent,Float:{-530.0,-2663.0,161.0}) // origin
}

}
public Message(pToucher, pTouched) 
{ 
    client_print(pTouched, print_chat, "TEst test test"); // testing

}
blood2k is offline
 


Thread Tools
Display Modes

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 17:59.


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