if(strcmp("/kick", cmd, true) == 0) { if(IsPlayerAdmin(playerid)) { tmp = strtok(cmdtext,idx); if(!strlen(tmp) || strlen(tmp) > 5) { return SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"USAGE: /kick [id] [reason]"); } new id = strval(tmp); if(!IsPlayerConnected(id)) { SendClientMessage(playerid,ERROR,"ERROR: Invalid Player ID"); return 1; } if(strlen(gMessage) == 0) { GetPlayerName(id,iName,sizeof(iName)); GetPlayerName(playerid,pName,sizeof(pName)); format(Message,sizeof(Message),"[INFO] %s [ID:%d] has kicked %s [ID:%d] for: No Reason Specified",pName,playerid,iName,id); SendClientMessageToAll(INFO,Message); Kick(id); { else(strlen(gMessage) > 0) //Line 160 } gMessage = strrest(cmdtext,idx); format(Message,sizeof(Message),"[INFO] %s [ID:%d] has kicked %s [ID:%d] for: %s",pName,playerid,iName,id,gMessage); SendClientMessageToAll(INFO,Message); Kick(id); return 1; { else { SendClientMessage(playerid,ERROR,"ERROR: You are not an admin!"); return 1; } } } }
C:\Users\User\Documents\samp\filterscripts\baseaf.pwn(58) : warning 225: unreachable code C:\Users\User\Documents\samp\filterscripts\baseaf.pwn(152) : warning 217: loose indentation C:\Users\User\Documents\samp\filterscripts\baseaf.pwn(159) : warning 217: loose indentation C:\Users\User\Documents\samp\filterscripts\baseaf.pwn(160) : error 029: invalid expression, assumed zero C:\Users\User\Documents\samp\filterscripts\baseaf.pwn(160 -- 161) : warning 215: expression has no effect C:\Users\User\Documents\samp\filterscripts\baseaf.pwn(161) : error 001: expected token: ";", but found "}" C:\Users\User\Documents\samp\filterscripts\baseaf.pwn(162) : warning 217: loose indentation C:\Users\User\Documents\samp\filterscripts\baseaf.pwn(167) : warning 225: unreachable code C:\Users\User\Documents\samp\filterscripts\baseaf.pwn(167) : warning 217: loose indentation C:\Users\User\Documents\samp\filterscripts\baseaf.pwn(168) : error 029: invalid expression, assumed zero C:\Users\User\Documents\samp\filterscripts\baseaf.pwn(178) : warning 217: loose indentation C:\Users\User\Documents\samp\filterscripts\baseaf.pwn(215) : error 030: compound statement not closed at the end of file (started at line 139)
if(!strcmp("/kick", cmdtext, true))
{
if(IsPlayerAdmin(playerid))
{
tmp = strtok(cmdtext,idx);
if(!strlen(tmp) || strlen(tmp) > 5)
{
SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"USAGE: /kick [id] [reason]");
return 0;
}
new id = strval(tmp);
if(!IsPlayerConnected(id))
{
SendClientMessage(playerid,ERROR,"ERROR: Invalid Player ID");
return 1;
}
if(strlen(gMessage) == 0)
{ {
GetPlayerName(id,iName,sizeof(iName));
GetPlayerName(playerid,pName,sizeof(pName));
format(Message,sizeof(Message),"[INFO] %s [ID:%d] has kicked %s [ID:%d] for: No Reason Specified",pName,playerid,iName,id);
SendClientMessageToAll(INFO,Message);
Kick(id);
{
else if(strlen(gMessage) > 0) //Line 160
{
gMessage = strrest(cmdtext,idx);
format(Message,sizeof(Message),"[INFO] %s [ID:%d] has kicked %s [ID:%d] for: %s",pName,playerid,iName,id,gMessage);
SendClientMessageToAll(INFO,Message);
Kick(id);
return 1;
}
else
{
SendClientMessage(playerid,ERROR,"ERROR: You are not an admin!");
return 1;
}
}
return 1;
}
if(strcmp("/kick", cmd, true) == 0)
{
if(IsPlayerAdmin(playerid))
{
tmp = strtok(cmdtext,idx);
if(!strlen(tmp) || strlen(tmp) > 5)
{
return SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"USAGE: /kick [id] [reason]");
}
new id = strval(tmp);
if(IsPlayerConnected(id))
{
if(strlen(gMessage) == 0)
{
GetPlayerName(id,iName,sizeof(iName));
GetPlayerName(playerid,pName,sizeof(pName));
format(Message,sizeof(Message),"[INFO] %s [ID:%d] has kicked %s [ID:%d] for: No Reason Specified",pName,playerid,iName,id);
SendClientMessageToAll(INFO,Message);
Kick(id);
{
else if(strlen(gMessage) > 0) //Line 160
}
gMessage = strrest(cmdtext,idx);
format(Message,sizeof(Message),"[INFO] %s [ID:%d] has kicked %s [ID:%d] for: %s",pName,playerid,iName,id,gMessage);
SendClientMessageToAll(INFO,Message);
Kick(id);
return 1;
{
else
{
SendClientMessage(playerid,ERROR,"ERROR: You are not an admin!");
return 1;
}
}
else
{
SendClientMessage(playerid,ERROR,"ERROR: Invalid Player ID");
}
}
return 1;
}
C:\Users\User\Documents\samp\filterscripts\baseaf.pwn(58) : warning 225: unreachable code C:\Users\User\Documents\samp\filterscripts\baseaf.pwn(160) : warning 217: loose indentation C:\Users\User\Documents\samp\filterscripts\baseaf.pwn(161) : error 029: invalid expression, assumed zero C:\Users\User\Documents\samp\filterscripts\baseaf.pwn(161) : warning 215: expression has no effect C:\Users\User\Documents\samp\filterscripts\baseaf.pwn(161) : error 001: expected token: ";", but found "if" C:\Users\User\Documents\samp\filterscripts\baseaf.pwn(176) : warning 217: loose indentation C:\Users\User\Documents\samp\filterscripts\baseaf.pwn(180) : warning 217: loose indentation C:\Users\User\Documents\samp\filterscripts\baseaf.pwn(217) : error 030: compound statement not closed at the end of file (started at line 139)
if(strcmp("/kick", cmd, true) == 0)
{
if(!IsPlayerAdmin(playerid))
{
SendClientMessage(playerid,ERROR,"ERROR: You are not an admin!");
return 1;
}
tmp = strtok(cmdtext,idx);
if(!strlen(tmp) || strlen(tmp) > 5)
{
return SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"USAGE: /kick [id] [reason]");
}
new id = strval(tmp);
if(!IsPlayerConnected(id))
{
SendClientMessage(playerid,ERROR,"ERROR: Invalid Player ID");
return 1;
}
GetPlayerName(id,iName,sizeof(iName));
GetPlayerName(playerid,pName,sizeof(pName));
gMessage = strrest(cmdtext,idx);
if(!strlen(gMessage))
{
gMessage = "No Reason Specified";
}
format(Message,sizeof(Message),"[INFO] %s [ID:%d] has kicked %s [ID:%d] for: %s",pName,playerid,iName,id,gMessage);
SendClientMessageToAll(INFO,Message);
Kick(id);
return 1;
}
pawn Код:
|
C:\Users\User\Documents\samp\filterscripts\baseaf.pwn(58) : warning 225: unreachable code C:\Users\User\Documents\samp\filterscripts\baseaf.pwn(157) : warning 217: loose indentation C:\Users\User\Documents\samp\filterscripts\baseaf.pwn(158) : error 029: invalid expression, assumed zero C:\Users\User\Documents\samp\filterscripts\baseaf.pwn(158) : warning 215: expression has no effect C:\Users\User\Documents\samp\filterscripts\baseaf.pwn(158) : error 001: expected token: ";", but found "if" C:\Users\User\Documents\samp\filterscripts\baseaf.pwn(159) : error 029: invalid expression, assumed zero C:\Users\User\Documents\samp\filterscripts\baseaf.pwn(160) : warning 217: loose indentation C:\Users\User\Documents\samp\filterscripts\baseaf.pwn(165) : warning 225: unreachable code C:\Users\User\Documents\samp\filterscripts\baseaf.pwn(165) : warning 217: loose indentation C:\Users\User\Documents\samp\filterscripts\baseaf.pwn(166) : error 029: invalid expression, assumed zero C:\Users\User\Documents\samp\filterscripts\baseaf.pwn(172) : warning 225: unreachable code C:\Users\User\Documents\samp\filterscripts\baseaf.pwn(172) : warning 217: loose indentation C:\Users\User\Documents\samp\filterscripts\baseaf.pwn(172) : error 029: invalid expression, assumed zero C:\Users\User\Documents\samp\filterscripts\baseaf.pwn(177) : warning 217: loose indentation C:\Users\User\Documents\samp\filterscripts\baseaf.pwn(178) : warning 225: unreachable code C:\Users\User\Documents\samp\filterscripts\baseaf.pwn(188) : warning 219: local variable "id" shadows a variable at a preceding level C:\Users\User\Documents\samp\filterscripts\baseaf.pwn(217) : error 030: compound statement not closed at the end of file (started at line 180)
pawn Код:
|
if(strcmp("/kick", cmd, true) == 0)
{
if(IsPlayerAdmin(playerid))
{
tmp = strtok(cmdtext,idx);
if(!strlen(tmp) || strlen(tmp) > 5)
{
return SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"USAGE: /kick [id] [reason]");
}
new id = strval(tmp);
if(IsPlayerConnected(id))
{
if(strlen(gMessage) == 0)
{
GetPlayerName(id,iName,sizeof(iName));
GetPlayerName(playerid,pName,sizeof(pName));
format(Message,sizeof(Message),"[INFO] %s [ID:%d] has kicked %s [ID:%d] for: No Reason Specified",pName,playerid,iName,id);
SendClientMessageToAll(INFO,Message);
Kick(id);
}
else if(strlen(gMessage) > 0) //Line 160
{
gMessage = strrest(cmdtext,idx);
format(Message,sizeof(Message),"[INFO] %s [ID:%d] has kicked %s [ID:%d] for: %s",pName,playerid,iName,id,gMessage);
SendClientMessageToAll(INFO,Message);
Kick(id);
return 1;
}
else
{
SendClientMessage(playerid,ERROR,"ERROR: You are not an admin!");
return 1;
}
}
else
{
SendClientMessage(playerid,ERROR,"ERROR: Invalid Player ID");
}
}
return 1;
}
Why ur pawnfile is in filterscripts? It should be in gamemodes! Well, the commands above should work perfectly!
|