SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 09/11/2012, 11:41 AM   #1
CrewMaster
Big Clucker
 
Join Date: Oct 2012
Location: Earth
Posts: 147
Reputation: 12
Default Chatbox problem

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
CrewMaster is offline   Reply With Quote
Old 09/11/2012, 12:01 PM   #2
gtakillerIV
Gangsta
 
gtakillerIV's Avatar
 
Join Date: Sep 2011
Location: UAE, Sharjah.
Posts: 985
Reputation: 201
Default Re: Chatbox problem

Please show us your OnPlayerText.
gtakillerIV is offline   Reply With Quote
Old 09/11/2012, 12:11 PM   #3
Faisal_khan
High-roller
 
Faisal_khan's Avatar
 
Join Date: Feb 2012
Location: Ireland and India
Posts: 1,826
Reputation: 208
Default Re: Chatbox problem

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.
__________________
Not a SAMP Dev. anymore.
Faisal_khan is offline   Reply With Quote
Old 09/11/2012, 02:32 PM   #4
CrewMaster
Big Clucker
 
Join Date: Oct 2012
Location: Earth
Posts: 147
Reputation: 12
Default Re: Chatbox problem

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;
}
CrewMaster is offline   Reply With Quote
Old 09/11/2012, 02:57 PM   #5
Konstantinos
Spam Machine
 
Konstantinos's Avatar
 
Join Date: Dec 2011
Posts: 11,828
Reputation: 1401
Default Re: Chatbox problem

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;
}
Konstantinos is offline   Reply With Quote
Old 10/11/2012, 02:41 AM   #6
CrewMaster
Big Clucker
 
Join Date: Oct 2012
Location: Earth
Posts: 147
Reputation: 12
Default Re: Chatbox problem

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 ...
CrewMaster is offline   Reply With Quote
Old 10/11/2012, 10:12 AM   #7
Konstantinos
Spam Machine
 
Konstantinos's Avatar
 
Join Date: Dec 2011
Posts: 11,828
Reputation: 1401
Default Re: Chatbox problem

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.
Konstantinos is offline   Reply With Quote
Reply

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
ChatBox Problem TheMaddox Server Support 2 16/07/2011 10:36 PM
ChatBox - 0.3c R3 pGibson Bug Reports 16 27/05/2011 07:22 AM
ID beside the name in the chatbox Jokerstyle Help Archive 3 09/05/2010 09:19 AM


All times are GMT. The time now is 11:01 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.