Raised This Month: $ Target: $400
 0% 

Making my own Phone Mod (TSRP)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
[cTs] Strake*ROC*
Member
Join Date: Mar 2004
Old 04-02-2005 , 22:17   Making my own Phone Mod (TSRP)
Reply With Quote #1

I cant find Phone Mod for TSRP anywhere, so i decided to make my own... could you guys tell me if anything is wrong with what i have so far? I am almost 99% sure there is, but i dont exactly know what....

Code:
/* AMX Mod X script. * * (c) 2004, Strake * This file is provided as is (no warranties). */ #include <amxmodx> #include <amxmisc> // Define new talkingto[33]; new calling[33]; public plugin_init(){     register_plugin("Template","1.0","Strake")     register_clcmd("say", "handle_say") } public handle_say(id) { new message; new command; read_data(2, command) if (command == "/call") { new arg2[52]; read_argv(2, arg2, 51); get_user_name(target, targetname, 51);     client_print(target, print_chat, "[Phone Mod] Your Phone is Ringing!")     client_print(target, print_chat, "[Phone Mod] Say ^"/answer^" to answer your phone.")     calling[target] == 1    } if (command == "/answer") { new arg2[52]; read_argv(2, arg2, 51); new target = cmd_target(id,arg2,3);     if (calling[id] == 1) {         talkingto[target] = 1         talkingto[id] = 1         calling[target] = 0     }     else {         client_print(id, print_chat, "[Phone Mod] Your Phone Is Not Ringing.")     } } // Note: Save Message as Message Said if (talkingto[target] == 1) { new arg2[52]; read_argv(2, arg2, 51); new target = cmd_target(id,arg2,3);     client_print(target, print_chat, "[Phone Mod] %s", message) } }
__________________
[cTs] Strake*ROC* is offline
smdobay
Member
Join Date: Feb 2005
Old 04-03-2005 , 01:23  
Reply With Quote #2

Maybe I'm missing something, but where does the transfer from arg2 to target occur in the /call statement?

Quote:
Code:
if (command == "/call") { new arg2[52]; read_argv(2, arg2 <-------    , 51); get_user_name(target <------  ?, targetname, 51);     client_print(target, print_chat, "[Phone Mod] Your Phone is Ringing!")     client_print(target, print_chat, "[Phone Mod] Say ^"/answer^" to answer your phone.")     calling[target] == 1     }
Again, maybe I missed it, but if you're using read_argv into a variable arg2 but fining a user with an unassigned variable, I'd wonder where the magical data assignment occurs.
smdobay is offline
[cTs] Strake*ROC*
Member
Join Date: Mar 2004
Old 04-03-2005 , 01:34  
Reply With Quote #3

This is what i have now, compiles fine, working on testing it now....:

Code:
/* AMX Mod X script. * * (c) 2004, Strake * This file is provided as is (no warranties). */ #include <amxmodx> #include <amxmisc> // Define new talkingto[33] = 0; new calling[33] = 0; public plugin_init(){     register_plugin("Template","1.0","Strake")     register_clcmd("say", "handle_say") } public handle_say(id) { new message; new command[101]; read_argv(1, command, 100); if(equali(command,"/call") == 1) { new arg2[52]; read_argv(2, arg2, 51); new target = cmd_target(id,arg2,3);     client_print(target, print_chat, "[Phone Mod] Your Phone is Ringing!")     client_print(target, print_chat, "[Phone Mod] Say ^"/answer^" to answer your phone.")     calling[target] = 1 } if(equali(command,"/answer") == 1) { new arg2[52]; read_argv(2, arg2, 51); new target = cmd_target(id,arg2,3);     if (calling[id] == 1) {         talkingto[target] = 1         talkingto[id] = 1         calling[target] = 0     }     else {         client_print(id, print_chat, "[Phone Mod] Your Phone Is Not Ringing.")     } } // Note: Save Message as Message Said if (talkingto[id] == 1) { new arg2[52]; read_argv(2, arg2, 51); new target = cmd_target(id,arg2,3);     client_print(target, print_chat, "[Phone Mod] %s", message) } if(equali(command,"/hangup") == 1) { new arg2[52]; read_argv(2, arg2, 51); new target = console_cmd(id,arg2,3); calling[id] = 0 talkingto[target] = 0 } }
__________________
[cTs] Strake*ROC* 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 09:49.


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