SA-MP Forums Archive
New Problem - 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: New Problem (/showthread.php?tid=664866)



New Problem - antixgaming - 13.03.2019

Delete


Re: New Problem - antixgaming - 13.03.2019

Any help?


Re: New Problem - xSkin - 13.03.2019

Put PreloadAnimLib(playerid,"FOOD"); OnPlayerSpawn?


Re: New Problem - v1k1nG - 13.03.2019

PHP код:
/*FOR LINE 7411:*/ warning 239literal array/string passed to a non-const parameter 
When defining strings, use const

PHP код:
static const Strig[256]; 



Re: New Problem - antixgaming - 14.03.2019

Nope. That just gave me more errors and warnings.


Re: New Problem - JesterlJoker - 14.03.2019

how about trying to do this?
PHP код:
new string[5]; // example holder for FOOD with 4 chars
memcpy(string"FOOD"05*45);
PreloadAnimLib(playeridstring); 
I don't know if it works though... just a guess


Re: New Problem - Kaliber - 14.03.2019

No, the error is, that you have to use const in the function header:

PHP код:
stock PreloadAnimLib(playerid, const animlib[]) ApplyAnimation(playerid,animlib,"null",0.0,0,0,0,0,0); 
That would fix the issue.

But i recommend you to use a macro:

PHP код:
#define PreloadAnimLib(%0,%1) ApplyAnimation(%0,%1,"null",0.0,0,0,0,0,0) 



Re: New Problem - antixgaming - 14.03.2019

Quote:
Originally Posted by JesterlJoker
Посмотреть сообщение
how about trying to do this?
PHP код:
new string[5]; // example holder for FOOD with 4 chars
memcpy(string"FOOD"05*45);
PreloadAnimLib(playeridstring); 
I don't know if it works though... just a guess
Nope. Won't work.

Quote:
Originally Posted by Kaliber
Посмотреть сообщение
No, the error is, that you have to use const in the function header:

PHP код:
stock PreloadAnimLib(playerid, const animlib[]) ApplyAnimation(playerid,animlib,"null",0.0,0,0,0,0,0); 
That would fix the issue.

But i recommend you to use a macro:

PHP код:
#define PreloadAnimLib(%0,%1) ApplyAnimation(%0,%1,"null",0.0,0,0,0,0,0) 
I tried you first but as I said, just gave me more errors. I will try second option. Maybe it will work.


Re: New Problem - antixgaming - 14.03.2019

Just tested that second thing with macro. Thanks. It works.