SA-MP Forums Archive
/inv command (New scripter) - 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: /inv command (New scripter) (/showthread.php?tid=264284)



/inv command (New scripter) - M4z - 25.06.2011

New to scripting, haven't used timers much atall and there are no errors in my code, but nothing happens when I do /inv ingame.
Code: http://pastebin.com/dLSrsiX8


Re: /inv command (New scripter) - iPLEOMAX - 25.06.2011

Change: SetTimerEx("inv",1000,true,"i");
To: SetTimerEx("inv",1000,true,"i",playerid);

Then give it a try..


Re: /inv command (New scripter) - Ash. - 25.06.2011

Quote:
Originally Posted by iPLEOMAX
Посмотреть сообщение
Change: SetTimerEx("inv",1000,true,"i");
To: SetTimerEx("inv",1000,true,"i",playerid);

Then give it a try..
Yes, do this.

In essence without the following variable (playerid) it should of crashed the server (from my experience, or my blondeness).

Quote:
Originally Posted by SAMP Forums
This forum requires that you wait 120 seconds between posts. Please try again in 54 seconds.
Really?


Re: /inv command (New scripter) - M4z - 25.06.2011

Thanks for the quick reply, its working fine now.


Re: /inv command (New scripter) - iPLEOMAX - 25.06.2011

One more TIP:

Add this to the top of your Script (This is an infinity float.):
pawn Код:
#define INF 0x107FFF
Then Add this to your command:
pawn Код:
SetPlayerHealth(playerid, INF);
This is easier, extremely better & less laggy.

No need for Timers.