SA-MP Forums Archive
Whats wrong with this script? - 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: Whats wrong with this script? (/showthread.php?tid=264833)



Whats wrong with this script? - FlightPlay - 27.06.2011

I keep getting errors but i dont see anything wrong with it.

Код:
public OnPlayerCommandText(playerid, cmdtext[])

	   (strcmp("/creds", cmdtext, true, 10) == 0)
	   {
	   SendClientMessage(playerid, 0x000000, "Pilotblaze1/Ryder3939. And **********.com");
	   return 1;
	 }
	 

	if (strcmp("/heal", cmdtext, true, 10) == 0)
	{
        SetPlayerHealth(playerid, 100)
        SendClientMessage(playerid, 0x000000, "You have been healed! You health has been restored to 100");
		return 1;
	 }
	 

    if (strcmp("/kill", cmdtext, true, 10) == 0)
    {
        SetPlayerHealth(playerid, 0);
        SendClientMessageToAll(0x000000, "Someone has commited suicide! Check the right side of your screen to see who it was.");
        SendClientMessage(playerid, 0x000000, "See you in heaven! Oh i just remembered,you commited suicide, you aint goin.");
        return 1;
	}
	
	if (strcmp("/pm", cmdtext, true, 10) == 0)
	{
         SendClientMessage(playerid, COLOR_RED, "Unfortunately, I do not know how to script /pm yet, So your assed out.");
		return 1;
	}
	return 0;
}



Re: Whats wrong with this script? - Falcon. - 28.06.2011

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/creds", true))
    {
        SendClientMessage(playerid, 0xFFFFFFAA, "Pilotblaze1/Ryder3939. And **********.com");
        return 0x1;
    }
   
    if(!strcmp(cmdtext, "/heal", true))
    {
        SetPlayerHealth(playerid, 0);
        SendClientMessageToAll(0xFFFFFFAA, "Someone has commited suicide! Check the right side of your screen to see who it was.");
        SendClientMessage(playerid, 0xFFFFFFAA, "See you in heaven! Oh i just remembered,you commited suicide, you aint goin.");
        return 0x1;
    }
   
    if(!strcmp(cmdtext, "/kill", true))
    {
        SendClientMessage(playerid, 0xFFFFFFAA, "Pilotblaze1/Ryder3939. And **********.com");
        return 0x1;
    }
   
    if(!strcmp(cmdtext, "/pm", true))
    {
        SendClientMessage(playerid, COLOR_RED, "Unfortunately, I do not know how to script /pm yet, So your assed out.");
        return 0x1;
    }
    return 0x0;
}



Re: Whats wrong with this script? - Tee - 28.06.2011

Please remove my post, I posted in the wrong topic >.<


Re: Whats wrong with this script? - [L3th4l] - 28.06.2011

That's just a hex with a value of 1 or true. 0x0 = 0, or false;


Re: Whats wrong with this script? - [L3th4l] - 28.06.2011

Quote:
Originally Posted by Colossus_
Посмотреть сообщение
Is there any benifits for using that?

0x0 is also a colour define xD

EDIT a BLACK colour define.
No advantage at all. It just makes it harder for some people to understand that meaning behind it. You can read more about it on a tutorial posted somewhere in the forums.