Help with Pawno Script Using If
#1

I have a problem where you use the command /flysf to go to San Fiero. It takes $2500 from your money but i need some script so if you dont have enough money you cannot go there.

Currently:
Код:
if (strcmp("/flysf", cmdtext, true, 10) == 0)
	{
		SetPlayerPos(playerid, -96.8143,-1197.3097,2.5853);
		GameTextForPlayer(playerid, "Arrived At San Fiero! (-$2500)",5000,5);   \
		GivePlayerMoney(playerid, -2500);
		return 1;
		}
I have tried:

Код:
if (strcmp("/flysf", cmdtext, true, 10) == 0)
	{
if pocketmoney <=0 then
GameTextForPlayer(playerid, "Not Enough Money!",5000,5);   \
else
		SetPlayerPos(playerid, -96.8143,-1197.3097,2.5853);
		GameTextForPlayer(playerid, "Arrived At San Fiero! (-$2500)",5000,5);   \
		GivePlayerMoney(playerid, -2500);
endif
		return 1;
		}
Reply
#2

Код:
	if (strcmp("/flysf", cmdtext, true, 10) == 0)
	{
		if(GetPlayerMoney(playerid) >= 2500)
		{
			SetPlayerPos(playerid, -96.8143,-1197.3097,2.5853);
			GameTextForPlayer(playerid, "Arrived At San Fiero! (-$2500)",5000,5);
			GivePlayerMoney(playerid, -2500);
		}
		else
		{
			SendClientMessage(playerid, COLOR_RED, "You don't have enough money! ($2500)");
		}
		return 1;
	}
Reply
#3


error:

Код:
C:\Program Files\Rockstar Games\GTA San Andreas\SAMP\Server\gamemodes\Freeroam.pwn(404) : error 017: undefined symbol "COLOR_RED"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#4

change COLOR_RED to whatever color you have defined
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)