SA-MP Forums Archive
whats wrong with these commands? - 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 these commands? (/showthread.php?tid=206836)



whats wrong with these commands? - justsomeguy - 04.01.2011

hello i have made these commands but they dont work can you pls take a look at it?
Код:
   	if (strcmp("/vommit", cmdtext, true, 10) == 0)
	{
	SendClientMessage(playerid, 0xFFFFFF, "Amfg what did you eat?! that color isnt very nice!.");
	SendClientMessage(playerid, 0xFFFFFF, "A f*ck al that vommiting made you a little disorientadet");
	ApplyAnimation(playerid,"PED","EAT_Vomit_SK  ",4.1,1,1,1,1,1);
    SetPlayerHealth(playerid,90.0);
	SetPlayerDrunkLevel (playerid, 5000);

	return 1;
			}
   	if (strcmp("/pee", cmdtext, true, 10) == 0)
	{
	SendClientMessage(playerid, 0xFFFFFF, "Omfg dont pee outside maybe there is a police in the neighberhood!.");
	ApplyAnimation(playerid,"PED","# Piss_in ",4.1,1,1,1,1,1);

	return 1;
			}
  	if (strcmp("/skate", cmdtext, true, 10) == 0)
	{
	SendClientMessage(playerid, 0xFFFFFF, "YAY! lets skate!!!.");
	ApplyAnimation(playerid,"PED","# skate_run   ",4.1,1,1,1,1,1);



Re: whats wrong with these commands? - alpha500delta - 04.01.2011

Apart from much grammar errors I dont see much wrong thins


Re: whats wrong with these commands? - justsomeguy - 04.01.2011

well i type the commands but the anims just dont load


Re: whats wrong with these commands? - iFriSki - 04.01.2011

https://sampwiki.blast.hk/wiki/ApplyAnimation -> Look at the 0.3b documentation and the force sync param


Re: whats wrong with these commands? - justsomeguy - 04.01.2011

ok sow now i got this:
Код:
   	if (strcmp("/vommit", cmdtext, true, 10) == 0)
	{
	SendClientMessage(playerid, 0xFFFFFF, "Amfg what did you eat?! that color isnt very nice!.");
	SendClientMessage(playerid, 0xFFFFFF, "A f*ck al that vommiting made you a little disorientadet");
	ApplyAnimation(playerid,"FOOD","EAT_Vomit_SK  ",4.1,1,1,1,1,1);
    SetPlayerHealth(playerid,90.0);
	SetPlayerDrunkLevel (playerid, 5000);

	return 1;
			}
   	if (strcmp("/pee", cmdtext, true, 10) == 0)
	{
	SendClientMessage(playerid, 0xFFFFFF, "Omfg dont pee outside maybe there is a police in the neighberhood!.");
	ApplyAnimation(playerid,"PAULNMAC","# Piss_in ",4.1,1,1,1,1,1);

	return 1;
			}
  	if (strcmp("/skate", cmdtext, true, 10) == 0)
	{
	SendClientMessage(playerid, 0xFFFFFF, "YAY! lets skate!!!.");
	ApplyAnimation(playerid,"SKATE","# skate_run   ",4.1,1,1,1,1,1);

	return 1;
			}
but that doesnt work either!


Re: whats wrong with these commands? - alpha500delta - 04.01.2011

With me I have to type the command 2 times in order for them to work, have you tried that?


Re: whats wrong with these commands? - justsomeguy - 04.01.2011

no that doesnt work either


Re: whats wrong with these commands? - jameskmonger - 04.01.2011

Quote:
Originally Posted by alpha500delta
Посмотреть сообщение
Apart from much grammar errors I dont see much wrong thins
*many wrong things.


Re: whats wrong with these commands? - iFriSki - 04.01.2011

Actually took a look at your code, as I over-looked it the first time. I do suggest you look into DCMD, but for now, this will work.

This is how I learned to make commands from the wiki, so please do bear with me for a moment. If you'd like I could do it in DCMD for you.
pawn Код:
if(!strcmp(cmdtext, "/vommit", true, 7)) // The number 7 represents the length of the command
    {
        SendClientMessage(playerid, 0xFFFFFF, "Amfg what did you eat?! that color isnt very nice!.");
        SendClientMessage(playerid, 0xFFFFFF, "A f*ck al that vommiting made you a little disorientadet");
        ApplyAnimation(playerid,"FOOD","EAT_Vomit_SK  ",4.1,1,1,1,1,1);
        SetPlayerHealth(playerid,90.0);
        SetPlayerDrunkLevel (playerid, 5000);
        return 1;
    }
    if(!strcmp(cmdtext, "/pee", true, 4)) // The number 4 represents the length of the command
    {
        SendClientMessage(playerid, 0xFFFFFF, "Omfg dont pee outside maybe there is a police in the neighberhood!.");
        ApplyAnimation(playerid,"PAULNMAC","# Piss_in ",4.1,1,1,1,1,1);
        return 1;
    }
    if(!strcmp(cmdtext, "/skate", true, 6))  // The number 6 represents the length of the command
    {
        SendClientMessage(playerid, 0xFFFFFF, "YAY! lets skate!!!.");
        ApplyAnimation(playerid,"SKATE","# skate_run   ",4.1,1,1,1,1,1);
        return 1;
    }



Re: whats wrong with these commands? - alpha500delta - 05.01.2011

Quote:
Originally Posted by jameskmonger
Посмотреть сообщение
*many wrong things.
I believe its "Any"