SA-MP Forums Archive
an command help. - 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: an command help. (/showthread.php?tid=110924)



an command help. - WardenCS - 28.11.2009

well,i have the problem,if i write /learngrabkick in right place and dont have money,it says you dont have money,but if i have it wont say anything,help.thanks command is here:

pawn Код:
if(strcmp(cmd, "/learngrabkick", true) == 0)
    {
      if(IsPlayerConnected(playerid))
      {
            if(GetPlayerMoney(playerid) < 5345)
                  {
                    SendClientMessage(playerid, COLOR_GREY, "You don't have enough money for a grabkick lessons");
                    return 1;
                  }
                        if (!PlayerToPoint(10, playerid,773.7303,1.4662,1001.1402))//elbow
            {
            if(PlayerInfo[playerid][grabkick] == 0)
            {
            SendClientMessage(playerid, COLOR_YELLOW, "Congratulations!You learned grabkick /styles to use it");
            PlayerInfo[playerid][grabkick] = 1;
            SafeGivePlayerMoney(playerid, - 5345);
            OnPlayerUpdate(playerid);
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD1, "You Already know how to grabkick!");
            }
            }
        }
        return 1;
    }



Re: an command help. - WardenCS - 29.11.2009

BUMP!anybody?


Re: an command help. - Niixie - 29.11.2009

im not a good scripter either, but ill try.

Guess you'll need to

Код:
if(strcmp(cmd, "/learngrabkick", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
  			if(GetPlayerMoney(playerid) < 5345)
		    {
			    SendClientMessage(playerid, COLOR_GREY, "You don't have enough money for a grabkick lessons");
		    }
                else
			{
			    if(PlayerInfo[playerid][grabkick] == 0)
			{
			    SendClientMessage(playerid, COLOR_YELLOW, "Congratulations! You learned grabkick /styles to use it");
			    PlayerInfo[playerid][grabkick] = 1;
			    SafeGivePlayerMoney(playerid, - 5345);
			    OnPlayerUpdate(playerid);
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD1, "You Already know how to grabkick!");
			}
		}
		return 1;
	}
*UNTESTED*

Dont know if it would work, but try it.
what do you use
Код:
if(!PlayerToPoint(10, playerid,773.7303,1.4662,1001.1402))//elbow
for?


Re: an command help. - Retardedwolf - 29.11.2009

Quote:
Originally Posted by Niixie
what do you use
Код:
if(!PlayerToPoint(10, playerid,773.7303,1.4662,1001.1402))//elbow
for?
Checks if the player is to the point.(In this script its like checks if the player is in the place where grabkick is learnt)


Re: an command help. - WardenCS - 29.11.2009

yeah :P...


Re: an command help. - Niixie - 29.11.2009

Oh, okay then the code would look something like this:

Код:
if(strcmp(cmd, "/learngrabkick", true) == 0)
{
  if(IsPlayerConnected(playerid))
  {
		if(!PlayerToPoint(10, playerid,773.7303,1.4662,1001.1402))//elbow
		{
			if(GetPlayerMoney(playerid) < 5345)
	    {
		    SendClientMessage(playerid, COLOR_GREY, "You don't have enough money for a grabkick lessons");
			}
     	else
			{
		    if(PlayerInfo[playerid][grabkick] == 0)
  			}
		    SendClientMessage(playerid, COLOR_YELLOW, "Congratulations! You learned grabkick /styles to use it");
		    PlayerInfo[playerid][grabkick] = 1;
		    SafeGivePlayerMoney(playerid, - 5345);
		    OnPlayerUpdate(playerid);
			{
			else
			}
				SendClientMessage(playerid, COLOR_GRAD1, "You Already know how to grabkick!");
				return 1;
		}
	}
	return 1;
}



Re: an command help. - WardenCS - 29.11.2009

C:\Documents and Settings\Ingrid\Desktop\MRP\gamemodes\larp.pwn(345 52) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Ingrid\Desktop\MRP\gamemodes\larp.pwn(345 5 : error 029: invalid expression, assumed zero

34552 : }
34558 : else


Re: an command help. - Niixie - 29.11.2009

try move the "}" up next to the "else" ...

like

}
else


Re: an command help. - WardenCS - 29.11.2009

pawno crashes then


Re: an command help. - Niixie - 29.11.2009

Hm, that weird.....

Tell me 100% what the command should do then i can rewrite it for you