SA-MP Forums Archive
/adminduty command 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)
+--- Thread: /adminduty command help (/showthread.php?tid=523576)



/adminduty command help - Sturra - 02.07.2014

Hi,

I have funny error and i cant understand it. Maybe you could help me out. Take a look:

Код:
CMD:adminduty(playerid, params[])
{
		if(IsPlayerConnected(playerid))
		{
		    if(gPlayerLogged[playerid] == 0)
		    {
		        SendClientMessage(playerid, COLOR_WHITE, "   Logi sisse ennem !");
				return 1;
		    }
		    if(PlayerData[playerid][AdminLevel] < 1) return SendUnathorizedMessage(playerid);
		    {
		        if(AdminDuty[playerid] == 0)
		        {
		            AdminDuty[playerid] = 1;
		            SetPlayerArmour(playerid, 999);
					SetPlayerHealth(playerid, 999);
					SetPlayerColor(playerid,COLOR_ORANGE);
					//GetPlayerName(playerid, sendername, sizeof(sendername));
					//format(string, sizeof(string), "AdminHoiatus: [ID:%d]%s lьlitas AOD sisse.", playerid, sendername);
					//ABroadCast(COLOR_YELLOW,string,1);
					SendClientMessage(playerid, COLOR_WHITE, "Sa lьlitasid AOD sisse.");
				}
		        else if(AdminDuty[playerid] == 1)
		        {
		            AdminDuty[playerid] = 0;
		            SetPlayerArmour(playerid, 0);
					SetPlayerHealth(playerid, 100);
					SetPlayerColor(playerid,TEAM_HIT_COLOR);
					GetPlayerName(playerid, sendername, sizeof(sendername));
					//format(string, sizeof(string), "AdminHoiatus: [ID:%d]%s lьlitab AOD vдlja.", playerid, sendername);
					//ABroadCast(COLOR_YELLOW,string,1);
					SendClientMessage(playerid, COLOR_WHITE, "Sa lьlitasid AOD vдlja.");
		return 1;
}
CMD:kick(playerid, params[]) <-- Error Line, but i dont get it what's wrong there.
{
	if(PlayerData[playerid][AdminLevel] < 1) return SendUnathorizedMessage(playerid);

	new target, reason[129], string[256];
	if(sscanf(params, "us[129]", target, reason)) return SendClientMessage(playerid, COLOR_SEABLUE, "Syntax:{FFFFFF} /kick [Player ID/Part of name] [Reason]");

	if(IsPlayerConnected(target)) {
	    if(!gIsPlayerLoggedIn[target]) return SendPlayerNotLoggedInMessage(playerid);
	    if(PlayerData[target][AdminLevel] > PlayerData[playerid][AdminLevel])
	    {
	        format(string, sizeof(string), "Admin:{FFFFFF} %s has been auto-kicked for attempting to kick %s.", GetPlayersName(target), GetPlayersName(playerid));
	        SendClientMessageToAll(COLOR_PALERED, string);
	        KickEx(playerid);
	        return 1;
	    }
	    format(string, sizeof(string), "Admin:{FFFFFF} %s has just kicked %s from the server, reason: %s.", GetPlayersName(playerid), GetPlayersName(target), reason);
	    SendClientMessageToAll(COLOR_PALERED, string);
	    KickEx(target);
	    return 1;
	}
	else
	{
	    SendPlayerNotConnectedMessage(playerid);
	}
	return 1;
}
Errors

Код:
F:\Users\Kasutaja\Desktop\MySQL SA-MP server\gamemodes\fortcarson.pwn(1176) : warning 217: loose indentation
F:\Users\Kasutaja\Desktop\MySQL SA-MP server\gamemodes\fortcarson.pwn(1178) : warning 217: loose indentation
F:\Users\Kasutaja\Desktop\MySQL SA-MP server\gamemodes\fortcarson.pwn(1178) : error 017: undefined symbol "@yC_kick"
F:\Users\Kasutaja\Desktop\MySQL SA-MP server\gamemodes\fortcarson.pwn(1178) : error 017: undefined symbol "@yC_kick"
F:\Users\Kasutaja\Desktop\MySQL SA-MP server\gamemodes\fortcarson.pwn(1178) : error 017: undefined symbol "i"
F:\Users\Kasutaja\Desktop\MySQL SA-MP server\gamemodes\fortcarson.pwn(1178) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.



Re: /adminduty command help - SHE790 - 02.07.2014

show the line


Re: /adminduty command help - Sturra - 02.07.2014

CMD:kick(playerid, params[]) <-- Error Line, but i dont get it what's wrong there.


Re: /adminduty command help - Opah - 02.07.2014

Have you included zcmd in your script ?


Re: /adminduty command help - SHE790 - 02.07.2014

did u used #include <zcmd>?/show ur enum


Re: /adminduty command help - Sturra - 02.07.2014

Quote:
Originally Posted by Opah
Посмотреть сообщение
Have you included zcmd in your script ?
Nope, but if i added this include same error's.
SHE790 what do you mean enum? Sorry newbie. :P


Re: /adminduty command help - SHE790 - 02.07.2014

This called Enum
Quote:

enum pData
{
pPassword,
pAdmin,
pMoney,
pScore,
pMute,
pFrozen,
pSpecating,
pSkin,
pWarn,
pSpam,
pDuty,
VIP,
}
new P_Data[MAX_PLAYERS][pData];




Re: /adminduty command help - Sturra - 02.07.2014

Quote:
Originally Posted by SHE790
Посмотреть сообщение
This called Enum
It's kinda a messy because i copied this from other gamemode. Does it effect some how?
Код:
enum pData {
	Fullname[126],
	Password[129],
	Float:PositionX,
	Float:PositionY,
	Float:PositionZ,
	Float:PositionA,
	Float:Health,
	Float:Armour,
	Interior,
	VirtualWorld,
	AdminLevel,
	AdminKey,
	Banned,
	BanReason[126],
	BannedBy[126],
	Warnings,
	Warning1Reason[126],
	Warning2Reason[126],
	Warning3Reason[126],
	WarnedBy1[126],
	WarnedBy2[126],
	WarnedBy3[126],
	Dead,
	HospitalTime
};
new PlayerData[MAX_PLAYERS][pData];



Re: /adminduty command help - SHE790 - 02.07.2014

do u have @yC_kick ? becouse it says u didnt defined this symbol

Note:I'm not sure


Re: /adminduty command help - Sturra - 02.07.2014

Nope, i can't find anywhere " @yC_kick "