Help!! - 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: Help!! (
/showthread.php?tid=248367)
Help!! -
BASITJALIL - 13.04.2011
Hey guys i have made a /kick command
When i compile it every thing is OK but 1 warning
pawn Код:
D:\Gta\Pwano\filterscripts\BJAdmSystem.pwn(366) : warning 203: symbol is never used: "kick"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Warning.
Can someone please tell me how to fix this warning?
Re: Help!! -
iJumbo - 13.04.2011
show us the code :d
Re: Help!! -
Rivera - 13.04.2011
can we see your command? we can't do anything without it
Re: Help!! -
BASITJALIL - 13.04.2011
Код:
CMD:kick(playerid,params[])
{
new id,reason[128];
if(PlayerInfo[playerid][pAdminLevel] < 1) return SendClientMessage(playerid,COLOR_RED,"You've To Be Admin To Use This Command");
if(sscanf(params,"us[128]",id,reason)) return SendClientMessage(playerid,COLOR_RED,"Usage : /kick [playerid] [Reason]");
if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED,"Player Doesn't Exist");
new pName[24],name[24];
GetPlayerName(playerid,pName,24);
GetPlayerName(id,name,24);
new string[128];
format(string,128,"You've Kicked from the server %s.Reason: %s",name,reason);
SendClientMessage(playerid,COLOR_YELLOW,string);
format(string,128,"You've Been Kicked from this server By %s. Reason : %s",pName,reason);
SendClientMessage(id,COLOR_RED,string);
format(string,128,"Admin %s has Kicked %s. Reason: %s",pName,name,reason);
SendClientMessageToAll(COLOR_YELLOW,string);
Kick(id);
format(string,sizeof(string),"%s Has been Kicked %s: Reason: %s",pName,name,reason);
return 1;
This is the code
Re: Help!! -
iJumbo - 13.04.2011
Line 366 = ? have you put the last } ?
Re: Help!! -
Rivera - 13.04.2011
Your script is a real mess. Here, use this:
pawn Код:
CMD:kick(playerid, params[]) {
new id, r;
if(sscanf(params, "uz", id, r)) {
if(IsPlayerAdmin(playerid)) {
if(id != INVALID_PLAYER_ID) {
new name[MAX_PLAYER_NAME], str[128];
GetPlayerName(id, name, MAX_PLAYER_NAME);
format(str, sizeof(str), "An Admin has kicked %s. Reason: %s", name, r);
SendClientMessageToAll(COLOR_LIGHTBLUE, str);
Kick(id);
}
else return SendClientMessage(playerid, COLOR_GREY, "Error: Player not found");
}
else return SendClientMessage(playerid, COLOR_BRIGHTRED, "You have no acces to this command");
}
else return SendClientMessage(playerid, COLOR_ORANGE, "Syntax Error: /kick [playerid/partofname] [reason (optional)]");
return 1;
}