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



Whats wrong with this code? - CJ101 - 18.02.2009

Код:
	if(strcmp(cmdtext, "/cbuy level", true) == 0)
	{
	if GetPlayerMoney(playerid) < 10000000
	*then
	{
	SendClientMessage(playerid,COLOR_ORANGE,"Purchase Complete. You are level 1.");
    }
  else
  {
  SendClientMessage(playerid,COLOR_LIGHTBLUE,"Error: You need at least $10,000,000 to buy level.");
  }
	
	return 1;
	}
no matter what, i always get error saying not enough cash.


Re: Whats wrong with this code? - darkrider366 - 18.02.2009

Код:
	
if(strcmp(cmdtext, "/cbuy level", true) == 0)
	{
	if GetPlayerMoney(playerid, =< 10000000)
	{
	SendClientMessage(playerid,COLOR_ORANGE,"Purchase Complete. You are level 1.");
    }
  else
  {
  SendClientMessage(playerid,COLOR_LIGHTBLUE,"Error: You need at least $10,000,000 to buy level.");
  }
	
	return 1;
}
erm... try that
no matter what, i always get error saying not enough cash.
[/quote]


Re: Whats wrong with this code? - Marcel - 18.02.2009

pawn Код:
if(strcmp(cmdtext, "/cbuy level", true) == 0)
 {
 if (GetPlayerMoney(playerid) < 10000000)
 {
 SendClientMessage(playerid,COLOR_ORANGE,"Purchase Complete. You are level 1.");
    }
  else
  {
  SendClientMessage(playerid,COLOR_LIGHTBLUE,"Error: You need at least $10,000,000 to buy level.");
  }
 
 return 1;
 }



Re: Whats wrong with this code? - Lazarus - 18.02.2009

Indent your codes .

pawn Код:
if(strcmp(cmdtext, "/cbuy level", true) == 0)
    {
        if(GetPlayerMoney(playerid) < 10000000)
        {
            SendClientMessage(playerid, COLOR_ORANGE, "Purchase Complete. You are level 1.");
        }
        else
        {
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "Error: You need at least $10,000,000 to buy level.");
        }
        return 1;
    }



Re: Whats wrong with this code? - Marcel - 18.02.2009

I am on my PSP so I just fixed the code, yours isn't good indented either.


Re: Whats wrong with this code? - Lazarus - 18.02.2009

Go lie to someone else (unless your making the point that you cant see indentation from a PSP, you have to make it clearer if so). Mine's how it's suppose to be.