How ???
#1

Hi all
How can i load player weapons?
If i save the weapons (with dini)
weapons=15:67,36:78,25:88

Then i get example:
weapon id: 15 with 67 bullets
and i get id 35 with 78 bullets
and i get id 25 with 88 bullets

How ?
Reply
#2

Well, you'll have to split the string, the easiest way to do that is using sscanf i guess. Take a look at the Useful Functions topic.
Reply
#3

But sscanf is for commands
How can i do it?
Reply
#4

Any??
How ?
With a split function? HOW?
Reply
#5

sscanf isn't just for commands, it's for strings with spaces in it =p So it will split a string by the spaces in it and give the exact type of variable oyu're looking for (Float, Integer, Player ID etc)
Reply
#6

cool can u give me a example?
with this code: 12 89 13 82
The weapon: 12 bullets: 89
The weapon: 13 bullets: 82
Reply
#7

new weapon[13];
new ammo[13];
sscanf(string,"iiiiiiiiiiiiiiiiiiiiiiiiii",weapon[0],ammo[0],weapon[1],ammo[1] ...// continue

****** should make it so you could just do 26i or something
Reply
#8

No 24
But normal in a command you do: sscnaf(params,"bla",bla) [red]return SendClientMessage......[/red]
But what now?
Reply
#9

https://sampwiki.blast.hk/wiki/Fast_Commands#sscanf
Reply
#10

No i don't mean!!!
Can anybody tell me what i need to add?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)