OnPlayerText 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: OnPlayerText Problem (
/showthread.php?tid=257240)
OnPlayerText Problem -
misho1 - 24.05.2011
Hi
I have problem i downloaded cell and i put it in my gm and When i type any thing in the chat it show my phone number and i am not calling any one
here the code
pawn Код:
public OnPlayerText(playerid, text[])
{
if (!player[playerid][calling] || player[playerid][caller] == 255)
{
new string[128];
format(string, 255, "(%d) %s", player[playerid][number], text);
SendPlayerMessageToAll(playerid, string);
}
else
{
new str[158];
GetPlayerName(playerid, str, 16);
format(str, sizeof(str), "(Cellphone)%s : %s", str, text);
SendClientMessage(player[playerid][caller], 0xBFC0C2FF, str);
SendClientMessage(playerid, 0xBFC0C2FF, str);
return 1;
}
if(afk[playerid] == 1)
{
SendClientMessage(playerid, COLOR_NORMALRED, "You can not chat while in AFK mode. Type /back to return");
return 1;
}
Re: OnPlayerText Problem -
Vince - 24.05.2011
Let me quote myself:
Quote:
Originally Posted by Vince
*sigh* You can't expect us to fix your "new" (read: copy-pasted) gamemode for you every time. Learn to code. I am absolutely fed up with people whose postcounts for 90% consists of 'bump help naw!' replies.
|
Obviously, you don't understand jack shit. Copy-pasting stuff and just hoping that it will work - and subsequently opening new topics if it doesn't work - gets you nowhere. Take this piece of code, for example:
pawn Код:
if (!player[playerid][calling] || player[playerid][caller] == 255)
{
new string[128];
format(string, 255, "(%d) %s", player[playerid][number], text);
SendPlayerMessageToAll(playerid, string);
}
If the player is not (
! operator) calling, then the phone number (
player[playerid][number]) should be shown? Does that make any sense to you?
Re: OnPlayerText Problem -
misho1 - 26.05.2011
i fixed it