SA-MP Forums Archive
How to send a ClientMessage in this? - 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: How to send a ClientMessage in this? (/showthread.php?tid=277649)



How to send a ClientMessage in this? - Rabbayazza - 18.08.2011

Код:
    if (strcmp("/ogate", cmdtext, true) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 20, 1544.94104004,-1622.77990723,12.38281250))
	{
        MoveObject(gate, 1544.63146973,-1631.57128906,12.38281250, 4.00);
        SendClientMessage(playerid, 0xFF000000, "You have successfully open the gate!");
	}
        return 1;
}
        if (strcmp("/cgate", cmdtext, true) == 0)
    {
    	if(IsPlayerInRangeOfPoint(playerid, 20, 1544.94104004,-1622.77990723,12.38281250))
	{
        MoveObject(gate, 1544.94104004,-1622.77990723,12.38281250, 4.00);
        SendClientMessage(playerid, 0xFF000000, "You have successfully closed the gate!");
	}
        return 1;
	}
I want to send a message saying you can't close the gate from here, instead of it being SERVER: Unknown Command, if you're not near the gate.


Re: How to send a ClientMessage in this? - Kush - 18.08.2011

Quote:
Originally Posted by Rabbayazza
Посмотреть сообщение
Код:
    if (strcmp("/ogate", cmdtext, true) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 20, 1544.94104004,-1622.77990723,12.38281250))
	{
        MoveObject(gate, 1544.63146973,-1631.57128906,12.38281250, 4.00);
        SendClientMessage(playerid, 0xFF000000, "You have successfully open the gate!");
	}
        return 1;
}
        if (strcmp("/cgate", cmdtext, true) == 0)
    {
    	if(IsPlayerInRangeOfPoint(playerid, 20, 1544.94104004,-1622.77990723,12.38281250))
	{
        MoveObject(gate, 1544.94104004,-1622.77990723,12.38281250, 4.00);
        SendClientMessage(playerid, 0xFF000000, "You have successfully closed the gate!");
	}
        return 1;
	}
I want to send a message saying you can't close the gate from here, instead of it being SERVER: Unknown Command, if you're not near the gate.
PHP код:
if (strcmp("/ogate"cmdtexttrue) == 0)
{
    if(!
IsPlayerInRangeOfPoint(playerid201544.94104004,-1622.77990723,12.38281250)) return SendClientMessage(playerid, -1"You are not near a gate!");
     
MoveObject(gate1544.63146973,-1631.57128906,12.382812504.00);
      
SendClientMessage(playerid0xFF000000"You have successfully open the gate!");
       return 
1;
}
if (
strcmp("/cgate"cmdtexttrue) == 0)
{
    if(!
IsPlayerInRangeOfPoint(playerid201544.94104004,-1622.77990723,12.38281250)) return SendClientMessage(playerid, -1"You are not near a gate!");
     
MoveObject(gate1544.94104004,-1622.77990723,12.382812504.00);
      
SendClientMessage(playerid0xFF000000"You have successfully closed the gate!");
       return 
1;