Can SomeBody Help WIth THis! -
[Lsgw]LoL - 19.05.2011
hello there it me again LoL i need from you help something about sscanf lets start:
i have do command for example we do /akill command we do in sscanf like this
if(sscanf(params,"us",pID,Reason)){
return SendClientMessage(playerid,COLOR_GREY,"|| Usage: /kick [playerid] [reason] ||");
}
now what i need how i can do when admin ! use this commands and put only like this
/kick 1 and he dont but any reason how i can do send him message say like this
You must put reason for this commands!
Re: Can SomeBody Help WIth THis! -
Toreno - 19.05.2011
Why would you need such a thing when sscanf does a simple and returns back this; "Usage: /kick [playerid] [reason]"
You can send another client message below that, like this way (It's not necessary AT all!).
pawn Код:
if(sscanf(params,"us",pID,Reason)) {
SendClientMessage(playerid,COLOR_GREY,"USAGE: /kick [playerid] [reason]");
SendClientMessage(playerid,COLOR_GREY,"DO NOT forget to write a reason!");
}
Re: Can SomeBody Help WIth THis! -
[Lsgw]LoL - 19.05.2011
not thats what i mean i mean after the admin write the command and press enter! when he do
/kick[id] [reason]
he do like this:
/kick 1
if he write the id alone with out any reason tell him! in message after he Press enter on /kick 1
"you forget the reason"
Re: Can SomeBody Help WIth THis! -
[Lsgw]LoL - 19.05.2011
Help!
Re: Can SomeBody Help WIth THis! -
Fj0rtizFredde - 19.05.2011
Add something like this:
pawn Код:
//Sscanf code and stuff first then this:
if(!strlen(Reason)) return SendClientMessage(playerid,-1,"You forgot to write a reason!");
//Then rest of code here!
Re: Can SomeBody Help WIth THis! -
Toreno - 19.05.2011
I was testing few option and it didn't work, I guess there is no way to do it with sscanf.
Re: Can SomeBody Help WIth THis! -
[Lsgw]LoL - 19.05.2011
i do what you say but i got this error:
C:\Users\LoL\Desktop\Lsgw\gamemodes\Lsgw.pwn(4143) : error 035: argument type mismatch (argument 1)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
Re: Can SomeBody Help WIth THis! -
Toreno - 20.05.2011
strlen doesn't work with sscanf, you can't do it unless you use strtok.
In my opinion, you should stay with sscanf and keep on without that little moron "You forgot the reason" message.