SA-MP Forums Archive
Chatbox problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Chatbox problem (/showthread.php?tid=391052)



Chatbox problem - CrewMaster - 09.11.2012

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


Re: Chatbox problem - gtakillerIV - 09.11.2012

Please show us your OnPlayerText.


Re: Chatbox problem - Faisal_khan - 09.11.2012

Quote:
Originally Posted by doreto
View Post
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.


Re: Chatbox problem - CrewMaster - 09.11.2012

The OnPlayerText Has Nothing :-
Code:
public OnPlayerText(playerid, text[])
{
	return 1;
But , i think i got some problems in here :-

Code:
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;
}



Re: Chatbox problem - Konstantinos - 09.11.2012

Replace the 'OnPlayerText' callback with this and tell me if it sends the message.
pawn Code:
public OnPlayerText( playerid, text[ ] )
{
    new
        textmsg[ 128 ]
    ;
    format( textmsg, sizeof ( textmsg ), "%s", text );
    SendPlayerMessageToAll( playerid, textmsg );
    return 0;
}



Re: Chatbox problem - CrewMaster - 10.11.2012

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 ...


Re: Chatbox problem - Konstantinos - 10.11.2012

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.