Search Ban With Dini - 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)
+--- Thread: Search Ban With Dini (
/showthread.php?tid=632174)
Search Ban With Dini -
Speaker - 10.04.2017
Code
Код:
CMD:sban(playerid,params[])
{
new playerb[32], string[128], file[32];
if(sscanf(params, "s[32]s[128]", playerb, params)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /offlineban [playername] [reason]");
format(file, sizeof(file), "ladmin/users/%s.sav", playerb);
if(!dini_Exists(file)) return SendClientMessage(playerid, COLOR_RED, "Player name not found.");
format(string, sizeof(string), "AdmCmd: %s is been banned", playerb);
SendClientMessageToAll(COLOR_RED, string);
if(!strcmp(dini_Get(file,"banned"),true)) {
Kick(playerid);
}
return 1; //Sweet
}
error
Код:
error 035: argument type mismatch (argument 2)
Help Plzz
Re: Search Ban With Dini -
khRamin78 - 10.04.2017
the problem is here
PHP код:
if(sscanf(params, "s[32]s[128]", playerb, params))
/* see that params ? u already defining it you have to make new string for reason
like :
new reason[64];
if(sscanf(params, "s[32]s[128]", playerb, reason)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /offlineban [playername] [reason]");
and can you explain me what is this ? kicking a player who wanted to ban a banned player ?
PHP код:
if(!strcmp(dini_Get(file,"banned"),true)) {
Kick(playerid);
}
and also this code wont ban him ! you have to save dini info of players beeing banned after banning him sending a client message wont make that player BANNED !
so you need something like this :
PHP код:
dini_IntSet(file, "banned", true);
and also you are not saving or using reason so why should you do that ?
you can do like this :
PHP код:
format(string, sizeof(string), "AdmCmd: %s is been banned for %s", playerb,reason);