Raised This Month: $ Target: $400
 0% 

User Spawn not working


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Des12
Senior Member
Join Date: Jan 2005
Old 01-06-2006 , 20:57   User Spawn not working
Reply With Quote #1

I am trying to make a plugin print "You have spawned" when a player spawns, and teleport that player twice if he has a certain steamid. All it has managed to do is give a 1/4 chance of server crashing everytime someone spawns.

Code:
#include <amxmodx> #include <amxmisc> #include <engine> #include <fun> public plugin_init() {     register_plugin("User Spawn","v1","Dest Romano")         register_event("ResetHUD","Event_ResetHUD","b")     } public Event_ResetHUD(id) {     client_print(id, print_chat, "[AMXX] You have respawned!")     new authid[32]     get_user_authid(id,authid,31)     if(equali(authid,"STEAM_0:0:4644907"))     {     new origin1[3] = { -554, 3636, 364 }     set_user_origin(id, origin1)     set_task(0.1,"tele2",id)         return PLUGIN_HANDLED     }     return PLUGIN_HANDLED } public tele2(id) {     new origin2[3] = { -1332, 3417, 196 }     set_user_origin(id, origin2)     return PLUGIN_HANDLED }

No compile errors either.
__________________
-Dest Romano

www.JustRP.com
A TSRP Server

Quote:
Originally Posted by Brad
Don't you go be bringing reality into this.
Des12 is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 01-06-2006 , 21:22  
Reply With Quote #2

Probably because you're using ResetHUD, which is called more than just by respawning.

It's not safe to use really, but here, try this:

Code:
#include <amxmodx> #include <amxmisc> #include <engine> #include <fun> public plugin_init() {     register_plugin("User Spawn","v1","Dest Romano")         register_event("ResetHUD","Event_ResetHUD","be") } public Event_ResetHUD(id) {     if(!is_user_alive(id))     {         return PLUGIN_HANDLED     }         client_print(id, print_chat, "[AMXX] You have respawned!")         new authid[32]     get_user_authid(id,authid,31)     if(equali(authid,"STEAM_0:0:4644907"))     {         new origin1[3] = { -554, 3636, 364 }         set_user_origin(id, origin1)         set_task(0.1,"tele2",id)     }         return PLUGIN_HANDLED } public tele2(id) {     new origin2[3] = { -1332, 3417, 196 }     set_user_origin(id, origin2)     return PLUGIN_HANDLED }
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Des12
Senior Member
Join Date: Jan 2005
Old 01-06-2006 , 22:38  
Reply With Quote #3

Thank you!
__________________
-Dest Romano

www.JustRP.com
A TSRP Server

Quote:
Originally Posted by Brad
Don't you go be bringing reality into this.
Des12 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 15:44.


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