SA-MP Forums Archive
[Help] How to Fix This?? - 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: [Help] How to Fix This?? (/showthread.php?tid=310207)



[Help] How to Fix This?? - dickyodie - 11.01.2012

I got an error in my script and can help me to fix it??

MY SCRIPT
Код:
//-----------[barrel trap]----------------//
	if (newkeys == KEY_FIRE)
	{
		if(IsPlayerInAnyVehicle(playerid))
		{
			new
				Float:x,
				Float:y,
				Float:z;
			{
		  	  if(GetPlayerMoney(playerid) >= 2000)
 	 			{
            		GetPlayerPos(playerid, x, y, z);
					CreateObject(1225,x,y,z, 0.00, 0.00, 0.00);
					GivePlayerMoney(playerid, -2000);
				}
   				else
				{
					SendClientMessage(playerid,purple,"You Dont Have Enough Money");
				}
			}
			else
			{
			SendClientMessage(playerid,purple,"You Must Be in Vehicle To Drop The Trap!");
			}
		}
		return 1;
	}
ERROR
Код:
C:\DOCUME~1\xp\Desktop\LZGSMI~1\GAMEMO~1\GM1.pwn(852) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
Please Help me


Re: [Help] How to Fix This?? - JamesC - 11.01.2012

You create x, y, z in lowercase but are creating the object using uppercase X, Y, Z.


Re: [Help] How to Fix This?? - dickyodie - 11.01.2012

and how to fix this error
C:\DOCUME~1\xp\Desktop\LZGSMI~1\GAMEMO~1\GM1.pwn(8 52) : error 029: invalid expression, assumed zero


Re: [Help] How to Fix This?? - T0pAz - 11.01.2012

PAWN is CaSe SeNsItIvE.

Edit: Your code is not properly aligned on blocks.


Re: [Help] How to Fix This?? - dickyodie - 11.01.2012

I have one more question
how to give time limit to this system
so players have to wait a minute longer to use this system again


Re: [Help] How to Fix This?? - T0pAz - 11.01.2012

Quote:
Originally Posted by dickyodie
Посмотреть сообщение
I have one more question
how to give time limit to this system
so players have to wait a minute longer to use this system again
use SetTimer.


Re: [Help] How to Fix This?? - Joe_ - 11.01.2012

Don't use set timer... use GetTickCount.