/kick command problem - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: /kick command problem (
/showthread.php?tid=247200)
/kick command problem -
BizzyD - 08.04.2011
Hello, i got a problem with my /kick cmd. When i do /kick ID. It just shows up the text again.
This is my command.
pawn Код:
new string[256];
new cmd[128];
new tmp[128];
new giveplayerid;
new idx;
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, "/kick", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_RED, "/kick id or name");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
if(PlayerInfo[playerid][pAdminLevel] >= 2)
{
if(giveplayerid != INVALID_PLAYER_ID)
{
Kick (giveplayerid);
}
}
}
return 1;
}
I cant figure it out.
So, Whats wrong with it?
Thanks,Alex
Re: /kick command problem -
HyperZ - 08.04.2011
I suggest you to use
Sscanf2 And
Zcmd.
Re: /kick command problem -
BizzyD - 08.04.2011
Quote:
Originally Posted by Clive
|
Yea, but first i need to fix it.
Re: /kick command problem -
Vince - 08.04.2011
Ehm no, not really. If you convert to sscanf you'll have to restructure your code anyway.
Quote:
Originally Posted by AlexzzPro
It just shows up the text again.
|
What text?
Re: /kick command problem -
BizzyD - 08.04.2011
Quote:
Originally Posted by Vince
Ehm no, not really. If you convert to sscanf you'll have to restructure your code anyway.
What text?
|
This shows up again when i try to kick myself
Код:
SendClientMessage(playerid, COLOR_RED, "/kick id or name");
Re: /kick command problem -
Snipa - 08.04.2011
Quote:
Originally Posted by AlexzzPro
Yea, but first i need to fix it.
|
All you have to do in sscanf is
pawn Код:
if(sscanf(params,"uz",user,reason)) return SendClientMessage(playerid,RED,"USAGE: /kick [id] [reason];
Then you have all your vars set up
Re: /kick command problem -
BizzyD - 08.04.2011
Quote:
Originally Posted by Snipa
All you have to do in sscanf is
pawn Код:
if(sscanf(params,"uz",user,reason)) return SendClientMessage(playerid,RED,"USAGE: /kick [id] [reason];
Then you have all your vars set up
|
I dont understand sscanf and zcmd. Thats why i am scripting it in strcmp
Re: /kick command problem -
xir - 08.04.2011
Then what about starting to read some tutorials, and if you need help with it, you can just post topics about it
Believe me, when you start working with zcmd and sscanf, you will say i love my life
The sa-mp forum is here to help you
Re: /kick command problem -
BizzyD - 08.04.2011
Yea i will start to learn it. but i want this in cmd in strcmp
Re: /kick command problem -
BizzyD - 08.04.2011
anyone knows the problem?