Raised This Month: $51 Target: $400
 12% 

i don't understanding get_user_origin


Post New Thread Reply   
 
Thread Tools Display Modes
Crazywelder1
Member
Join Date: Mar 2004
Location: CA
Old 02-09-2005 , 20:36  
Reply With Quote #11

i have another question am i wrong or is this plugin not suppose generate a lighting bolt but just a sprite above his head after the person goes to godmode????

Code:
#include <amxmodx> #include <amxmisc> #include <fun> #include <engine> new light public plugin_init() {      register_plugin("God Like Player", "0.5", "Garrett")      register_clcmd("say givemegod", "saygod", ADMIN_KICK, "-gives player godmode") } public plugin_precache() {      light = precache_model("sprites/lgtning.spr")      return PLUGIN_CONTINUE } public saygod(id) {     if( !(get_user_flags(id)&ADMIN_KICK) )     {     client_print(id, print_chat, "[AMXX] HAHAHA nice try!")     return PLUGIN_HANDLED     }     else if(get_user_flags(id)&ADMIN_KICK)     {     set_user_godmode(id, 1)     get_user_godmode(id)     client_print(id, print_chat, "[AMXX] You are now in god mode!")     return PLUGIN_CONTINUE }     new origin[3]     get_user_origin(id,origin)      message_begin(MSG_ALL,SVC_TEMPENTITY)     write_byte(7) // number of tempevent     write_coord(origin[0]) // x coord     write_coord(origin[1]) // y coord     write_coord(origin[2]) // z coord     write_coord(origin[0]) // x2 coord     write_coord(origin[1]) // y2 coord     write_coord(origin[2] + 10) // z2 coord     write_byte(2) // life     write_byte(5) // width     write_byte(5) // amplitude     write_short(light) // sprite index     message_end()     return PLUGIN_HANDLED   }
__________________
AKA = oM`|Garrett
oM CLAN
Soon to have a server in Soon
Crazywelder1 is offline
Send a message via MSN to Crazywelder1
xeroblood
BANNED
Join Date: Mar 2004
Location: Toronto, Canada
Old 02-10-2005 , 11:36  
Reply With Quote #12

@v3x:
I did, and I am working on it.. It should be pretty simple.. Hopefully wont take too long

@Crazywelder1:

Try this:

Code:
#include <amxmodx> #include <amxmisc> #include <fun> #include <engine> // Sprites new g_sprLight new g_sprSmoke // Sound Files new g_szSndThunder[] = "ambience/thunder_clap.wav" public plugin_init() {      register_plugin("God Like Player", "0.5", "Garrett")      register_clcmd("say givemegod", "saygod", ADMIN_KICK, "-gives player godmode") } public plugin_precache() {     g_sprLight  = precache_model( "sprites/lgtning.spr" )     g_sprSmoke  = precache_model( "sprites/steam1.spr" )         precache_sound( g_szSndThunder )     return PLUGIN_CONTINUE } public saygod(id) {     if( !(get_user_flags(id)&ADMIN_KICK) )     {         client_print(id, print_chat, "[AMXX] HAHAHA nice try!")         return PLUGIN_HANDLED     }     set_user_godmode(id, 1)     client_print(id, print_chat, "[AMXX] You are now in god mode!")     ThrowLightning( id )         return PLUGIN_HANDLED      } stock ThrowLightning( id ) {     if( is_user_alive(id) )     {         new vec1[3], vec2[3]         get_user_origin( id, vec1 ) // Body Origin         vec1[2] -= 26          // Feet Origin         // make lightning look like it comes from sky..         vec2[0] = vec1[0] + 150         vec2[1] = vec1[1] + 150         vec2[2] = vec1[2] + 400         // Some Thunder Sound...         emit_sound( id, CHAN_ITEM, g_szSndThunder, 1.0, ATTN_NORM, 0, PITCH_NORM )         //Lightning         message_begin( MSG_BROADCAST, SVC_TEMPENTITY )         write_byte( 0 )         write_coord( vec2[0] )         write_coord( vec2[1] )         write_coord( vec2[2] )         write_coord( vec1[0] )         write_coord( vec1[1] )         write_coord( vec1[2] )         write_short( g_sprLight )         write_byte( 1 )             // framestart         write_byte( 5 )             // framerate         write_byte( 2 )             // life         write_byte( 20 )            // width         write_byte( 30 )            // noise         write_byte( 200 )           // r, g, b         write_byte( 200 )           // r, g, b         write_byte( 200 )           // r, g, b         write_byte( 200 )           // brightness         write_byte( 200 )           // speed         message_end()         //Sparks         message_begin( MSG_PVS, SVC_TEMPENTITY, vec1 )         write_byte( 9 )         write_coord( vec1[0] )         write_coord( vec1[1] )         write_coord( vec1[2] )         message_end()         //s2smoke         message_begin( MSG_BROADCAST, SVC_TEMPENTITY, vec1 )         write_byte( 5 )         write_coord( vec1[0] )         write_coord( vec1[1] )         write_coord( vec1[2] )         write_short( g_sprSmoke )         write_byte( 10 )         write_byte( 10 )         message_end()     }     return }
xeroblood is offline
Send a message via MSN to xeroblood
Crazywelder1
Member
Join Date: Mar 2004
Location: CA
Old 02-10-2005 , 19:02  
Reply With Quote #13

ok thanks again i figured the other wasn't lightning but just a sprite that goes over the head
NVM(never mind)!! thank you anyways..
__________________
AKA = oM`|Garrett
oM CLAN
Soon to have a server in Soon
Crazywelder1 is offline
Send a message via MSN to Crazywelder1
TotalNoobScripter
Senior Member
Join Date: Aug 2004
Old 02-10-2005 , 20:12  
Reply With Quote #14

id help if i could understand your grammar.
TotalNoobScripter is offline
Send a message via AIM to TotalNoobScripter
Timmi the savage
Senior Member
Join Date: Jul 2004
Location: seattle
Old 03-07-2005 , 20:44   This is just smaller but more advanced.
Reply With Quote #15

Slightly more advanced and compact version.
Code:
stock ThrowLightning( id )  {     if( is_user_alive(id) )  {         new vec1[3], vec2[3]         get_user_origin( id, vec1 ) // Body Origin         vec1[2] -= 26            // Feet Origin         // make lightning look like it comes from sky..         for (new veca = 0 ; veca < 1 ; veca++) vec2[veca] = vec1[veca] + 150         vec2[2] = vec1[2] + 400         // Some Thunder Sound...         emit_sound( id, CHAN_ITEM, g_szSndThunder, 1.0, ATTN_NORM, 0, PITCH_NORM )         //Lightning         message_begin( MSG_BROADCAST, SVC_TEMPENTITY )         write_byte( 0 )         for (new begin = 0 ; begin < 2 ; begin++)  write_coord( vec2[begin] )         for (new end = 0 ; end < 2 ; end++)  write_coord( vec1[end] )         write_short( g_sprLight )         write_byte( 1 )             // framestart         write_byte( 5 )             // framerate         write_byte( 2 )             // life         write_byte( 20 )            // width         write_byte( 30 )            // noise         for new i = 0 ; i < 4 ; i++) write_byte( 200 ) // All the rest was 200. writes 5 times         message_end()                 //Sparks         message_begin( MSG_PVS, SVC_TEMPENTITY, vec1 )         write_byte( 9 )         for (new vecc = 0 ; vecc < 2 ; vecc++) write_coord( vec1[vecc] )         message_end()                 //s2smoke         message_begin( MSG_BROADCAST, SVC_TEMPENTITY, vec1 )         write_byte( 5 )         for (new vecb = 0 ; vecb < 2 ; vecb++) write_coord( vec1[vecb] )         write_short( g_sprSmoke )         for (new i = 0 ; i < 1 ; i++) write_byte( 10 )         message_end()     }     return }

also this too.

Code:
public saygod(id) {     if( !(get_user_flags(id)&ADMIN_KICK) ) {         client_print(id, print_chat, "[AMXX] HAHAHA nice try!")         return PLUGIN_HANDLED     }     else if(get_user_flags(id)&ADMIN_KICK) {         set_user_godmode(id, 1)         get_user_godmode(id)         client_print(id, print_chat, "[AMXX] You are now in god mode!")         return PLUGIN_CONTINUE     }     new origin[3]     get_user_origin(id,origin)        message_begin(MSG_ALL,SVC_TEMPENTITY)     write_byte(7) // number of tempevent     for (new write = 0 ; write < 2 ; write++) write_coord(origin[write]) // x y z coords     for (new write2 = 0 ; write2 < 1 ; write2++) write_coord(origin[write2]) // x2 y2 coords     write_coord(origin[2] + 10) // z2 coord        write_byte(2) // life     for (new byte = 0 ; byte < 1; byte++) write_byte(5) // width and then amp     write_short(light) // sprite index     message_end()     return PLUGIN_HANDLED      }
Timmi the savage is offline
Send a message via Yahoo to Timmi the savage
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 10:48.


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