PDA

View Full Version : SendClientMEssage


SomebodyAndMe
31/08/2011, 07:08 PM
Hi, i made this script but it doesn't work, can someone help me, here is the script:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/fishhelp", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid, 0x000000, "Fisherman: Fisherman takes boat from base [Dock, island, what ever], \r types /work and goed to checkpoint. Checkpoint is in sea, he fishes here \n [so he needs to stay there a while[maybe drive thru markers]].\n Once loaded he goes to base and unloads the fish.\n ");
return 1;
}
return 0;
}

Naruto_Emilio
31/08/2011, 07:12 PM
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/fishhelp", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid, 0x300FFAAB, "Fisherman: Fisherman takes boat from base [Dock, island, what ever], \r types /work and goed to checkpoint. Checkpoint is in sea, he fishes here \n [so he needs to stay there a while[maybe drive thru markers]].\n Once loaded he goes to base and unloads the fish.\n ");
return 1;
}
return 0;
}

uprp
31/08/2011, 07:14 PM
If i'm not mistaken, using return 0; is like saying, ignore the command....

Naruto_Emilio
31/08/2011, 07:15 PM
If i'm not mistaken, using return 0; is like saying, ignore the command....

if like he type /fsihghzelp it will return a SERVER: UNKNOWN COMMand and it doesnt have any sence with his problem, his probleme is the colour name, he used 0x000000 and thats not a colour code

SomebodyAndMe
31/08/2011, 07:18 PM
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/fishhelp", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid, 0x300FFAAB, "Fisherman: Fisherman takes boat from base [Dock, island, what ever], \r types /work and goed to checkpoint. Checkpoint is in sea, he fishes here \n [so he needs to stay there a while[maybe drive thru markers]].\n Once loaded he goes to base and unloads the fish.\n ");
return 1;
}
return 0;
}
Sorry not working.. also changed color code not working...

Naruto_Emilio
31/08/2011, 07:19 PM
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/fishhelp", cmdtext, true, 9) == 0)
{
SendClientMessage(playerid, 0x300FFAAB, "Fisherman: Fisherman takes boat from base [Dock, island, what ever], types /work and goed to checkpoint. Checkpoint is in sea, he fishes here [so he needs to stay there a while[maybe drive thru markers]. Once loaded he goes to base and unloads the fish.");
return 1;
}
return 0;
}

Amel_PAtomAXx
31/08/2011, 07:43 PM
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmdtext,"/fishhelp",true) == 0)
{
SendClientMessage(playerid, 0x300FFAAB, "Fisherman: Fisherman takes boat from base [Dock, island, what ever], types /work and goed to checkpoint. Checkpoint is in sea, he fishes here [so he needs to stay there a while[maybe drive thru markers]. Once loaded he goes to base and unloads the fish.");
return 1;
}
return 1;
}

Swyft
31/08/2011, 09:12 PM
Hi, i made this script but it doesn't work, can someone help me, here is the script:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/fishhelp", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid, 0x000000, "Fisherman: Fisherman takes boat from base [Dock, island, what ever], \r types /work and goed to checkpoint. Checkpoint is in sea, he fishes here \n [so he needs to stay there a while[maybe drive thru markers]].\n Once loaded he goes to base and unloads the fish.\n ");
return 1;
}
return 0;
}


The only problem with it was your Color coding,

use Naruto's Example, if you want just PM me and I can give you some Color Defines so you just type COLOR_NAME or whatever.

=WoR=Varth
01/09/2011, 03:05 AM
You can't use \n, \r or anything like them in client message.

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/fishhelp", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid, 0x000000, "Fisherman: Fisherman takes boat from base [Dock, island, what ever], types /work and goed to checkpoint. Checkpoint is in sea, he fishes here");
SendClientMessage(playerid, 0x000000, "[so he needs to stay there a while[maybe drive thru markers]].");
SendClientMessage(playerid, 0x000000, "Once loaded he goes to base and unloads the fish.");
return 1;
}
return 0;
}

Tanush123
01/09/2011, 04:45 AM
I dont use strcmp but try


if (strcmp("/fishhelp", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid,-1, "Fisherman: Fisherman takes boat from base [Dock, island, what ever], types /work and goed to checkpoint. Checkpoint is in sea, he fishes here");
SendClientMessage(playerid,-1, "[so he needs to stay there a while[maybe drive thru markers]].");
SendClientMessage(playerid,-1, "Once loaded he goes to base and unloads the fish.");
return 1;
}