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)
}
}
__________________