SA-MP Forums Archive
Command in range point [HELP] +REP - 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)
+--- Thread: Command in range point [HELP] +REP (/showthread.php?tid=570517)



Command in range point [HELP] +REP - Chausar - 11.04.2015

am i did correct?

Код:
if (strcmp(cmdtext, "/boxing", true) == 0)
    {
       if(IsPlayerInRangeOfPoint(playerid, 7.0, 768.1320, 7.1274, 1000.7133))
    {
        SetPlayerFightingStyle (playerid, FIGHT_STYLE_BOXING);
        SendClientMessage(playerid, 0xFFFFFFAA, "You have changed your fighting style to boxing!");
        GivePlayerMoney(playerid, -4000);
        return 1;
    }
i gave lots of error.. pls fix if player dont have enough money..i want it return error message


Re: Command in range point [HELP] +REP - Can4ns - 11.04.2015

Код:
 if (strcmp(cmdtext, "/boxing", true, 7) == 0)
    {
      	if(IsPlayerInRangeOfPoint(playerid, 7.0, 768.1320, 7.1274, 1000.7133))
    	{
        if(GetPlayerMoney(playerid) <4000) return SendClientMessage(playerid,-1, "Not enough money!");
        SetPlayerFightingStyle (playerid, FIGHT_STYLE_BOXING);
        SendClientMessage(playerid, -1, "You have changed your fighting style to boxing!");
        GivePlayerMoney(playerid, -4000);
		}
	}
return 1;
}
hmm?


Re: Command in range point [HELP] +REP - FernandoLight - 11.04.2015

Quote:
Originally Posted by Can4ns
Посмотреть сообщение
Код:
 if (strcmp(cmdtext, "/boxing", true, 7) == 0)
    {
      	if(IsPlayerInRangeOfPoint(playerid, 7.0, 768.1320, 7.1274, 1000.7133))
    	{
        if(GetPlayerMoney(playerid) <4000) return SendClientMessage(playerid,-1, "Not enough money!");
        SetPlayerFightingStyle (playerid, FIGHT_STYLE_BOXING);
        SendClientMessage(playerid, -1, "You have changed your fighting style to boxing!");
        GivePlayerMoney(playerid, -4000);
		}
	}
return 1;
}
hmm?
Try it.