SA-MP Forums Archive
Run time Error 4, after changing the command. - 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: Run time Error 4, after changing the command. (/showthread.php?tid=612118)



Run time Error 4, after changing the command. - Luicy. - 14.07.2016

Hi, so after I added the clothes part of /buy in a store, it gave me debug errors and the command didn't work in game.

http://prntscr.com/bst9sp

Full /buy command;
http://pastebin.com/qsLpRST4

I did ******, and I do understand the problem, but couldn't find out why in my code.


Re: Run time Error 4, after changing the command. - AbyssMorgan - 14.07.2016

Problem here is
PHP код:
format(nFormat128"%s"Stores[GetPlayerVirtualWorld(playerid)+500][Name]); 
PHP код:
//virtualworld = 509
StoresGetPlayerVirtualWorld(playerid)+500 //index 509 + 500 = 1009

//I think you wanted to do
//virtualworld = 509
StoresGetPlayerVirtualWorld(playerid)-500 //index 509 - 500 = 9 



Re: Run time Error 4, after changing the command. - Luicy. - 14.07.2016

Quote:
Originally Posted by AbyssMorgan
Посмотреть сообщение
Problem here is
PHP код:
format(nFormat128"%s"Stores[GetPlayerVirtualWorld(playerid)+500][Name]); 
PHP код:
//virtualworld = 509
StoresGetPlayerVirtualWorld(playerid)+500 //index 509 + 500 = 1009
//I think you wanted to do
//virtualworld = 509
StoresGetPlayerVirtualWorld(playerid)-500 //index 509 - 500 = 9 
Nope, stores virtual world are 500+, I believe I meant only getplayervw, Gonna test this.
Edit; You're right, thanks.