Strings and pawn
Hello, I just started making my plugin and its almost complete, I have a string which goes like this: "%STEAMID%STEAMID%STEAMID"
now how I get each STEAMID? and how can I kick each one from the server? 10x ahead It just stupid using string with pawn (sorry I come from per :|) Also I could test if a string starts with "CHK" ;\ 10x. |
Re: Strings and pawn
Quote:
Code:
|
Re: Strings and pawn
goku: No.
To split strings, like your trying to do, use this stock. Code:
You can use it like this: Code:
You can kick them, continuing on the code above, like this: Code:
Let me know if you have any compile time errors. |
Re: Strings and pawn
Oh I misunderstood what he was asking :S.
|
Re: Strings and pawn
Hello again,
Thank you so much! I had that ExplodeString routine but I didn't know excatly how to use it, Now I know. Some obious questions: Is 32 here is max length of the steamid? new steamid[3][32]; I didn't know kick steamID from the console works :| I was sure I tried it :\ Anyway thanks ill continue from here :D |
Re: Strings and pawn
You forgot one of the parameters with the explode (input string).
Also that kick didn't work for me, after look in how amx_kick can kick steamIDs I learned how to kick them :) here is what I did in the end: Code:
new steamid[32][32]; |
Re: Strings and pawn
Ok, pretty decent for your level. But use get_players() for your for loop. Check in funcwiki on how to use it.
And instead of this: Code:
Just do this: Code:
No point in creating a buffer there ;-). |
Re: Strings and pawn
Yea i know i didn't have to use reason...
Where did you suggest me to use get players? I mean I know where it needs to be but it also means if ill use get_players I'll have to loop more times than this... |
Re: Strings and pawn
No you won't. Use it in the loop where you kick people.
|
| All times are GMT -4. The time now is 00:45. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.