Error?
#1

I get this error when compiling

Код:
/gamemodes/OnGameMode.pwn(11667) : error 001: expected token: ";", but found "-identifier-"
/gamemodes/OnCommand.pwn(18109) : warning 202: number of arguments does not match definition
/gamemodes/OnCommand.pwn(18109) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
This is my code on line 11667 (its a command actually)
Код:
COMMAND:jail(playerid, params[])
{
	new text[128],time,targetid,string[256],sendername[MAX_PLAYER_NAME],giveplayer[MAX_PLAYER_NAME];
	if(sscanf(params, "uis[128]", targetid, time, text)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /jail [playerid] [minutes] [reason]");
	else
	{
	    if (GetPVarInt(playerid, "PlayerLogged") == 0) return SendClientMessage(playerid, COLOR_WHITE, "You must be logged in to use this.");
	    if (!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_WHITE, "This player is not connected !");
	    if(IsPlayerNPC(targetid)) return SendClientMessage(playerid, COLOR_GREY, "Can't do this to a NPC.");
	    if(strlen(text) >= 100) return SendClientMessage(playerid, COLOR_WHITE, "Reason is too long.");
		if(GetPVarInt(playerid, "Admin") >= 2)
		{
   			format(sendername, sizeof(sendername), "%s", AdminName(playerid));
      		format(giveplayer, sizeof(giveplayer), "%s", PlayerName(targetid));
      		GiveNameSpace(sendername);
      		GiveNameSpace(giveplayer);
      		format(string, sizeof(string), "AdmCmd: %s was jailed by %s, reason: %s", giveplayer, sendername, text);
			SendAdminMessage(COLOR_LIGHTRED, string);
			SetPVarInt(targetid, "Jailed", 2);
			SetPVarInt(targetid, "JailTime", time*60);
			strmid(PlayerInfo[targetid][pJailReason], text, 0, strlen(text), 255);
			format(string, sizeof(string), "You are jailed for %d minutes.", time);
			SendClientMessage(targetid, COLOR_WHITE, string);
			format(string, sizeof(string), "REASON: %s.", text);
			SendClientMessage(targetid, COLOR_WHITE, string);
			SetPlayerPos(targetid,2523.9197,-1673.8944,14.8589);
            TogglePlayerControllableEx(targetid, false);
            SetPlayerInterior(targetid, 0);
            SetPlayerVirtualWorld(targetid, targetid);
            SetPVarInt(targetid, "Jails", GetPVarInt(targetid, "Jails")+1);
            SetPVarInt(targetid, "Mute", 1);
		}
		else
		{
		    SendClientMessage(playerid, COLOR_LIGHTRED, "You do not have access to this command !");
		}
	}
	return 1;
}
Return 1; is line 11667

thanks, dunno how to fix this. please help
Reply
#2

Try that:
PHP код:
COMMAND:jail(playeridparams[])
{
    new 
text[128],time,targetid,string[256],sendername[MAX_PLAYER_NAME],giveplayer[MAX_PLAYER_NAME];
    if(
sscanf(params"uis[128]"targetidtimetext)) SendClientMessage(playeridCOLOR_GREY"USAGE: /jail [playerid] [minutes] [reason]");
    else
    {
        if (
GetPVarInt(playerid"PlayerLogged") == 0) return SendClientMessage(playeridCOLOR_WHITE"You must be logged in to use this.");
        if (!
IsPlayerConnected(targetid)) return SendClientMessage(playeridCOLOR_WHITE"This player is not connected !");
        if(
IsPlayerNPC(targetid)) return SendClientMessage(playeridCOLOR_GREY"Can't do this to a NPC.");
        if(
strlen(text) >= 100) return SendClientMessage(playeridCOLOR_WHITE"Reason is too long.");
        if(
GetPVarInt(playerid"Admin") >= 2)
        {
               
format(sendernamesizeof(sendername), "%s"AdminName(playerid));
              
format(giveplayersizeof(giveplayer), "%s"PlayerName(targetid));
              
GiveNameSpace(sendername);
              
GiveNameSpace(giveplayer);
              
format(stringsizeof(string), "AdmCmd: %s was jailed by %s, reason: %s"giveplayersendernametext);
            
SendAdminMessage(COLOR_LIGHTREDstring);
            
SetPVarInt(targetid"Jailed"2);
            
SetPVarInt(targetid"JailTime"time*60);
            
strmid(PlayerInfo[targetid][pJailReason], text0strlen(text), 255);
            
format(stringsizeof(string), "You are jailed for %d minutes."time);
            
SendClientMessage(targetidCOLOR_WHITEstring);
            
format(stringsizeof(string), "REASON: %s."text);
            
SendClientMessage(targetidCOLOR_WHITEstring);
            
SetPlayerPos(targetid,2523.9197,-1673.8944,14.8589);
            
TogglePlayerControllableEx(targetidfalse);
            
SetPlayerInterior(targetid0);
            
SetPlayerVirtualWorld(targetidtargetid);
            
SetPVarInt(targetid"Jails"GetPVarInt(targetid"Jails")+1);
            
SetPVarInt(targetid"Mute"1);
        }
        else
        {
            
SendClientMessage(playeridCOLOR_LIGHTRED"You do not have access to this command !");
        }
    return 
1;

Reply
#3

Quote:
Originally Posted by jlalt
Посмотреть сообщение
Try that:
PHP код:
COMMAND:jail(playeridparams[])
{
    new 
text[128],time,targetid,string[256],sendername[MAX_PLAYER_NAME],giveplayer[MAX_PLAYER_NAME];
    if(
sscanf(params"uis[128]"targetidtimetext)) SendClientMessage(playeridCOLOR_GREY"USAGE: /jail [playerid] [minutes] [reason]");
    else
    {
        if (
GetPVarInt(playerid"PlayerLogged") == 0) return SendClientMessage(playeridCOLOR_WHITE"You must be logged in to use this.");
        if (!
IsPlayerConnected(targetid)) return SendClientMessage(playeridCOLOR_WHITE"This player is not connected !");
        if(
IsPlayerNPC(targetid)) return SendClientMessage(playeridCOLOR_GREY"Can't do this to a NPC.");
        if(
strlen(text) >= 100) return SendClientMessage(playeridCOLOR_WHITE"Reason is too long.");
        if(
GetPVarInt(playerid"Admin") >= 2)
        {
               
format(sendernamesizeof(sendername), "%s"AdminName(playerid));
              
format(giveplayersizeof(giveplayer), "%s"PlayerName(targetid));
              
GiveNameSpace(sendername);
              
GiveNameSpace(giveplayer);
              
format(stringsizeof(string), "AdmCmd: %s was jailed by %s, reason: %s"giveplayersendernametext);
            
SendAdminMessage(COLOR_LIGHTREDstring);
            
SetPVarInt(targetid"Jailed"2);
            
SetPVarInt(targetid"JailTime"time*60);
            
strmid(PlayerInfo[targetid][pJailReason], text0strlen(text), 255);
            
format(stringsizeof(string), "You are jailed for %d minutes."time);
            
SendClientMessage(targetidCOLOR_WHITEstring);
            
format(stringsizeof(string), "REASON: %s."text);
            
SendClientMessage(targetidCOLOR_WHITEstring);
            
SetPlayerPos(targetid,2523.9197,-1673.8944,14.8589);
            
TogglePlayerControllableEx(targetidfalse);
            
SetPlayerInterior(targetid0);
            
SetPlayerVirtualWorld(targetidtargetid);
            
SetPVarInt(targetid"Jails"GetPVarInt(targetid"Jails")+1);
            
SetPVarInt(targetid"Mute"1);
        }
        else
        {
            
SendClientMessage(playeridCOLOR_LIGHTRED"You do not have access to this command !");
        }
    return 
1;

Now I get these errors:
Код:
../gamemodes/OnConnect.pwn(206) : error 017: undefined symbol "ResetPlayerWeaponsEx"
../gamemodes/OnConnect.pwn(213) : error 017: undefined symbol "StopAudioStreamForPlayerEx"
../gamemodes/OnConnect.pwn(221) : error 017: undefined symbol "GetMaxIPs"
../gamemodes/OnConnect.pwn(236) : error 017: undefined symbol "PlayerName"
../gamemodes/OnConnect.pwn(239) : error 017: undefined symbol "KickEx"
../gamemodes/OnConnect.pwn(244) : error 017: undefined symbol "PlayerName"
../gamemodes/OnConnect.pwn(247) : error 004: function "LoginLog" is not implemented
../gamemodes/OnConnect.pwn(257) : error 017: undefined symbol "CheckIP"
../gamemodes/OnConnect.pwn(258) : error 004: function "FixHour" is not implemented
../gamemodes/OnConnect.pwn(259) : error 017: undefined symbol "PlayerName"
../gamemodes/OnConnect.pwn(275) : error 017: undefined symbol "PlayerName"
../gamemodes/OnConnect.pwn(276) : error 017: undefined symbol "SendAdminMessage"
../gamemodes/OnConnect.pwn(289) : error 017: undefined symbol "PlayerName"
../gamemodes/OnConnect.pwn(290) : error 017: undefined symbol "SendAdminMessage"
../gamemodes/OnConnect.pwn(303) : error 017: undefined symbol "PlayerName"
../gamemodes/OnConnect.pwn(304) : error 017: undefined symbol "SendAdminMessage"
../gamemodes/OnGameMode.pwn(15) : error 017: undefined symbol "split"
../gamemodes/OnGameMode.pwn(67) : error 017: undefined symbol "split"
../gamemodes/OnGameMode.pwn(132) : error 017: undefined symbol "split"
../gamemodes/OnGameMode.pwn(158) : error 017: undefined symbol "split"
../gamemodes/OnGameMode.pwn(191) : error 017: undefined symbol "split"
../gamemodes/OnGameMode.pwn(233) : error 017: undefined symbol "split"
../gamemodes/OnGameMode.pwn(297) : error 017: undefined symbol "split"
../gamemodes/OnGameMode.pwn(321) : error 017: undefined symbol "split"
../gamemodes/OnGameMode.pwn(347) : error 017: undefined symbol "split"
../gamemodes/OnGameMode.pwn(374) : error 004: function "FixHour" is not implemented

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


26 Errors.
Reply
#4

fixed.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)