PDA

View Full Version : Chatbox problem


CrewMaster
09/11/2012, 11:41 AM
Hello guys , i wanted to fix 1 thing that when a player status is 0 or he is not an admin he cant Chat on Main Chat ...If the player is Admin/moderator ... he can chat in Main ..... Please fix my problem

gtakillerIV
09/11/2012, 12:01 PM
Please show us your OnPlayerText.

Faisal_khan
09/11/2012, 12:11 PM
NO


WRONG SECTION
http://forum.sa-mp.com/showthread.php?t=187229

Dude he is not asking for a code to be made for him. He wants his problem to be fixed.

OT:
Paste your OnPlayerText callback codes.

CrewMaster
09/11/2012, 02:32 PM
The OnPlayerText Has Nothing :-
public OnPlayerText(playerid, text[])
{
return 1;

But , i think i got some problems in here :-

CMD:r(playerid,params[]) {
#pragma unused params
if(isnull(params)) return SendClientMessage(playerid, ORANGE, "USAGE: /R [text] to talk in Team Chat");
new Name[MAX_PLAYER_NAME]; GetPlayerName(playerid, Name, sizeof(Name));
new string[128];
format(string, sizeof(string), "[R][Team Chat] %s: %s", Name, params[0]);
printf("%s", string);

for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && gTeam[i] == gTeam[playerid]) SendClientMessage(i, RED, string);
}
return 1;
}

CMD:myteam(playerid, params[])
{
if(gTeam[playerid] == TEAM_GERMANY)
{
SendClientMessage(playerid, ORANGE, "Class Verification: You are Apart of Germany Team");
}
else if(gTeam[playerid] == TEAM_IRAQ)
{
SendClientMessage(playerid, ORANGE, "Class Verification: You are Apart of Taliban Cell");
}
else if(gTeam[playerid] == TEAM_RUSSIA)
{
SendClientMessage(playerid, ORANGE, "Class Verification: You are Apart of Soviet Union");
}
else if(gTeam[playerid] == TEAM_USA)
{
SendClientMessage(playerid, ORANGE, "Class Verification: You are Apart of United States of America");
}
else if(gTeam[playerid] == TEAM_BANGLADESH)
{
SendClientMessage(playerid, ORANGE, "Class Verification: You are Apart of European Alliance Team");
}
return 1;
}





CMD:cmds(playerid, params[])
{
ShowPlayerDialog(playerid, RED, DIALOG_STYLE_MSGBOX, "{FFFF00}General Player Commands","{FFFF00}/R || /MyTeam || /MyRank || /Duel [ID + Your ID] || /W || /Objective\n/Help ||/Admins || /NeonShop || /Kill || /Rules || /Switch || Bank","I accept","");
return 1;
}


CMD:objective(playerid, params[]) {
ShowPlayerDialog(playerid, RED, DIALOG_STYLE_MSGBOX, "{FFFF00}Help","{F0F0F0}|| Increase Rank /Myrank, /Ranks || Defend your Base || Earn Score By killing Players!","Ok","");
return 1;
}
CMD:help(playerid, params[])
{
ShowPlayerDialog(playerid, RED, DIALOG_STYLE_MSGBOX, "{FFFF00}Help","{F0F0F0}Read /Cmds /Rules /Objective For More Info","Ok","");
return 1;
}

CMD:rules(playerid, params[])
{
ShowPlayerDialog(playerid, RED, DIALOG_STYLE_MSGBOX, "{FFFF00}Rules","{F0F0F0}/Do not Spawn Kill \n/Do not disrespect Players/Staff \n/Do not Park over People \n/Do not use Any Hacks \n/Do not Swear \n/C-BUG IS ALLOWED)","Ok","");
return 1;
}
CMD:switch(playerid, params[])
{
SetPlayerHealth(playerid, 0.0);
ForceClassSelection(playerid);
SendClientMessage(playerid, ORANGE,"Class Selection: Select your New Team!");
return 1;
}

Konstantinos
09/11/2012, 02:57 PM
Replace the 'OnPlayerText' callback with this and tell me if it sends the message.
public OnPlayerText( playerid, text[ ] )
{
new
textmsg[ 128 ]
;
format( textmsg, sizeof ( textmsg ), "%s", text );
SendPlayerMessageToAll( playerid, textmsg );
return 0;
}

CrewMaster
10/11/2012, 02:41 AM
Still the problem is same ......

The player with 0 status or he is not an admin for him the chat is disable and whatever he type we cant see or he only can see ...

Konstantinos
10/11/2012, 10:12 AM
There is only one solution! Check any include/filterscript you're using and press 'Ctrl + F', type on the box 'OnPlayerText' and press enter, read the code inside the callback and if it says anything such as (if players are not admins, they are unable to talk on the chat) and delete it.