Can SomeBody Help WIth THis!
#1

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!
Reply
#2

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!");
}
Reply
#3

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"
Reply
#4

Help!
Reply
#5

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!
Reply
#6

I was testing few option and it didn't work, I guess there is no way to do it with sscanf.
Reply
#7

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.
Reply
#8

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.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)