SA-MP Forums Archive
Help with this please - 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 with this please (/showthread.php?tid=572250)



Help with this please - aCloudy - 26.04.2015

What is wrong with this ?
PHP код:
    HasWeed[IDDrugDealer[playerid]] = HasWeed[IDDrugDealer[playerid]] - WeedAmount[playerid]; 
ERRORS:
Код:
C:\Program Files\lvcnrr\gamemodes\NewSVR.pwn(10280) : error 033: array must be indexed (variable "WeedAmount")
C:\Program Files\lvcnrr\gamemodes\NewSVR.pwn(10281) : error 033: array must be indexed (variable "WeedAmount")
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.



Re: Help with this please - Mencent - 26.04.2015

Hello!

Try this:
PHP код:
HasWeed[IDDrugDealer[playerid]] = HasWeed[IDDrugDealer[playerid]] - WeedAmount[IDDrugDealer[playerid]]; 



Re: Help with this please - aCloudy - 26.04.2015

Quote:
Originally Posted by Mencent
Посмотреть сообщение
Hello!

Try this:
PHP код:
HasWeed[IDDrugDealer[playerid]] = HasWeed[IDDrugDealer[playerid]] - WeedAmount[IDDrugDealer[playerid]]; 
Sorry, But I updated the script line..


Re: Help with this please - Mencent - 26.04.2015

Ok. Can you share the declaration of WeedAmount?


Re: Help with this please - aCloudy - 26.04.2015

Quote:
Originally Posted by Mencent
Посмотреть сообщение
Ok. Can you share the declaration of WeedAmount?
new WeedAmount[MAX_PLAYERS];


Re: Help with this please - Mencent - 26.04.2015

Ok. Can you send me more code?


Re: Help with this please - JaydenJason - 26.04.2015

Error 033: array must be indexed (variable name)
An array as a whole cannot be used in a expression; you must indicate an element of the array between square brackets.


Re: Help with this please - aCloudy - 26.04.2015

Quote:
Originally Posted by JaydenJason
Посмотреть сообщение
Error 033: array must be indexed (variable name)
An array as a whole cannot be used in a expression; you must indicate an element of the array between square brackets.
I didn't understand you.
Can you show me an example please ?