Add this stuff in ---------------------- // RPG.pwn // ---------------------- OnGameModeInit for(new i=0; i "); return 1; } if(strcmp(tmp, "create", true) ==0) { new tmp2[256]; tmp2 = strtok(cmdtext, index); if(UserData[playerid][pChatChan] != -1) { SendErrMsg(playerid, "Leave your current channel first using /channel leave"); return 1; } if(!strlen(tmp2)) { SendErrMsg(playerid, "Usage: /channel create "); return 1; } if(strval(tmp2) > 100 || strval(tmp2) < 0) { SendErrMsg(playerid, "Usage: /channel create "); return 1; } if(ChatChans[strval(tmp2)][cInUse] != -1) { SendErrMsg(playerid, "Channel Number already in use, pick another number"); return 1; } if (UserData[playerid][pCalling] >= 0 || UserData[playerid][pCall] >= 0) { SendMsg(playerid,"You hung up the phone because you joined a chat channel."); new calling = UserData[playerid][pCalling]; if (calling >= 0) { UserData[calling][pCalling] = (-1); } new callid = UserData[playerid][pCall]; if (callid >= 0 && IsPlayerConnected(callid)) { format(tmp, sizeof(tmp), "%s hung up the phone because they joined a chat channel", PlayerName(playerid)); SendMsg(callid,tmp); UserData[callid][pCall] = UserData[callid][pCalling] = -1; } UserData[playerid][pCall] = UserData[playerid][pCalling] = -1; return 1; } UserData[playerid][pChatChan] = strval(tmp2); ChatChans[strval(tmp2)][cInUse] = 1; ChatChans[strval(tmp2)][cOwner] = playerid; new string[256]; format(string, sizeof(string), "You have created a chat channel, ID: %d", strval(tmp2)); SendInfMsg(playerid, string); SendInfMsg(playerid, "Put a # infront of your chat to speak to the server"); return 1; } if(strcmp(tmp, "join", true) ==0) { new tmp2[256]; tmp2 = strtok(cmdtext, index); if(UserData[playerid][pChatChan] != -1) { SendErrMsg(playerid, "Leave your current channel first using /channel leave"); return 1; } if(!strlen(tmp2)) { SendErrMsg(playerid, "Usage: /channel join "); return 1; } if(strval(tmp2) > 100 || strval(tmp2) < 0) { SendErrMsg(playerid, "Usage: /channel join "); return 1; } if(ChatChans[strval(tmp2)][cInUse] == -1) { SendErrMsg(playerid, "Channel Number not in use, pick another number"); return 1; } if (UserData[playerid][pCalling] >= 0 || UserData[playerid][pCall] >= 0) { SendMsg(playerid,"You hung up the phone because you joined a chat channel."); new calling = UserData[playerid][pCalling]; if (calling >= 0) { UserData[calling][pCalling] = (-1); } new callid = UserData[playerid][pCall]; if (callid >= 0 && IsPlayerConnected(callid)) { format(tmp, sizeof(tmp), "%s hung up the phone because they joined a chat channel", PlayerName(playerid)); SendMsg(callid,tmp); UserData[callid][pCall] = UserData[callid][pCalling] = -1; } UserData[playerid][pCall] = UserData[playerid][pCalling] = -1; return 1; } UserData[playerid][pChatChan] = strval(tmp2); new string[256]; format(string, sizeof(string), "You have joined a chat channel, ID: %d", strval(tmp2)); SendInfMsg(playerid, string); SendInfMsg(playerid, "Put a # infront of your chat to speak to the server"); return 1; } if(strcmp(tmp, "leave", true) ==0) { if(UserData[playerid][pChatChan] == -1) { SendErrMsg(playerid, "You're not currently in a chat channel"); return 1; } if(ChatChans[UserData[playerid][pChatChan]][cOwner] == playerid) { SendErrMsg(playerid, "You are the owner of this chat chan, use /channel remove instead"); return 1; } UserData[playerid][pChatChan] = -1; SendInfMsg(playerid, "You have left the chat channel"); return 1; } if(strcmp(tmp, "remove", true) ==0) { if(UserData[playerid][pChatChan] == -1) { SendErrMsg(playerid, "You're not currently in a chat channel"); return 1; } if(ChatChans[UserData[playerid][pChatChan]][cOwner] != playerid) { SendErrMsg(playerid, "You are not the owner of this chat chan, use /channel leave instead"); return 1; } for(new i=0; i"); return 1; } new lookupid; if(NameLookup(playerid,tmp,lookupid,1) != 1) return 1; if(lookupid == playerid) { SendErrMsg(playerid, "You cannot kick yourself!"); return 1; } if(UserData[lookupid][pChatChan] != UserData[playerid][pChatChan]) { SendErrMsg(playerid, "This player is not in your chat channel"); return 1; } UserData[lookupid][pChatChan] = -1; SendInfMsg(lookupid, "You were kicked from the channel by it's owner"); new string[256]; format(string, sizeof(string), "%s was kicked from the channel by %s", PlayerName(lookupid), PlayerName(playerid)); SendChanMsg(UserData[playerid][pChatChan], string); return 1; } if(strcmp(tmp, "help", true) ==0) { SendInfMsg(playerid, "Chat Channels allow you to create a private conversation for you"); SendInfMsg(playerid, "and your friends, they can be used for anything you can think of."); SendInfMsg(playerid, "To join one, use /channel join. You must close all phone conversations"); SendInfMsg(playerid, "to join or a create a channel. While in a channel you can talk to the"); SendInfMsg(playerid, "rest of the server by putting a # at the front of your message."); return 1; } return 1; }