help me fix these errors with /kick cmd -
mittukuttan - 12.01.2013
CMD:kick(playerid, params[]){ new pID, aName[MAX_PLAYER_NAME], reason[64], kickstring[128],pName[MAX_PLAYER_NAME]; // SA-MP cannot show messages longer then 128 cells anyways if(sscanf(params, "is[64]", pID, reason) return SendClientMessage(playerid, -1, " USAGE:/kick [playerid/name] [reason]"); if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COL_RED, " You are not allowed to do that!");}else{ GetPlayerName(playerid,aName,MAX_PLAYER_NAME); GetPlayerName(pID,pName,MAX_PLAYER_NAME); format(kickstring, sizeof(kickstring), "AdmCmd:%s has kicked %s for : %s", aName, pName, reason); SendClientMessageToAll(COL_RED, kickstring); ' Kick(pID); return 1;}
errors:
--------------------------------------------------------------------------------
C:\Users\intel\Desktop\JERIN'S MAGIC WORLD\samp\gamemodes\YOUNGS-WORLD.pwn(695) : warning 217: loose indentation
C:\Users\intel\Desktop\JERIN'S MAGIC WORLD\samp\gamemodes\YOUNGS-WORLD.pwn(695) : error 001: expected token: ")", but found "return"
C:\Users\intel\Desktop\JERIN'S MAGIC WORLD\samp\gamemodes\YOUNGS-WORLD.pwn(696) : warning 217: loose indentation
C:\Users\intel\Desktop\JERIN'S MAGIC WORLD\samp\gamemodes\YOUNGS-WORLD.pwn(694) : warning 204: symbol is assigned a value that is never used: "pName"
C:\Users\intel\Desktop\JERIN'S MAGIC WORLD\samp\gamemodes\YOUNGS-WORLD.pwn(694) : warning 204: symbol is assigned a value that is never used: "kickstring"
C:\Users\intel\Desktop\JERIN'S MAGIC WORLD\samp\gamemodes\YOUNGS-WORLD.pwn(694) : warning 204: symbol is assigned a value that is never used: "aName"
C:\Users\intel\Desktop\JERIN'S MAGIC WORLD\samp\gamemodes\YOUNGS-WORLD.pwn(694 -- 697) : warning 209: function "cmd_kick" should return a value
C:\Users\intel\Desktop\JERIN'S MAGIC WORLD\samp\gamemodes\YOUNGS-WORLD.pwn(694 -- 69 : error 010: invalid function or declaration
C:\Users\intel\Desktop\JERIN'S MAGIC WORLD\samp\gamemodes\YOUNGS-WORLD.pwn(694 -- 704) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
3 Errors.
Re: help me fix these errors with /kick cmd -
EAsT-OAK_510 - 12.01.2013
Why did you make another post about the same thing?
https://sampforum.blast.hk/showthread.php?tid=406798
Re: help me fix these errors with /kick cmd -
DaRk_RaiN - 12.01.2013
pawn Код:
CMD:kick(playerid, params[])
{
new pID, aName[MAX_PLAYER_NAME], reason[64], kickstring[128],pName[MAX_PLAYER_NAME];
if(sscanf(params, "is[64]", pID, reason)) return SendClientMessage(playerid, -1, " USAGE:/kick [playerid/name] [reason]");
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0066C8, " You are not allowed to do that!");
GetPlayerName(playerid,aName,MAX_PLAYER_NAME);
GetPlayerName(pID,pName,MAX_PLAYER_NAME); format(kickstring, sizeof(kickstring), "AdmCmd:%s has kicked %s for : %s", aName, pName, reason);
SendClientMessageToAll(0xFF0066C8, kickstring);
Kick(pID);
return 1;
}