format string array to integer?
#1

Hi all

My script is working almost fine, except I can't figure out how to convert a string array into an integer.
What I'm trying to do is create a command to give a player a weapon + ammo.

Here's the code:
http://pastebin.com/6AuSscwT

When I try passing the parameters to the GivePlayerWeapon function, it returns an error stating there's an argument type mismatch.
I suppose that's cause I'm trying to give it strings instead of integers...

For simplicity of the uploaded script, I just made a statement to display the variables in the console window, to prove that the variables are being passed, and they are. (As string, unfortunately)

If anyone could show me how to convert/format or show a better way to do this, that'd be awesome TIA


This'd be so much easier if I could just get variables down :P
Reply
#2

https://sampwiki.blast.hk/wiki/Strval

pawn Код:
new FirstInt = strval(tmp1);
Reply
#3

Quote:
Originally Posted by Carlton
Посмотреть сообщение
https://sampwiki.blast.hk/wiki/Strval

pawn Код:
new FirstInt = strval(tmp1);
Awesome awesome awesome!!!
I looked in the wiki... Guess I over-looked it. My bad..
Thanks for the fast reply Better yet thanks for helping out!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)