Why Am I Getting These Errors??
#1

Код:
#include <a_samp>
#define FILTERSCRIPT
#define COLOR_PINK 0xFF66FFAA
#define lightgreen 0x38FF06FF
#define orange 0xFF9900AA
#define COLOR_LEMON 0xDDDD2357
#define blue 0x375FFFFF

public OnPlayerCommandText(playerid,cmdtext[])
{
	if(!strcmp(cmdtext, "/commands", true, 9))
	{
		SendClientMessage(playerid, lightgreen, "Server Commands: /anims, /stopanim, /placefw, /launchfw, /votekick, /vehiclemenu, /sellhouse, /trunk, /park, /sellcar ");
        SendClientMessage(playerid, lightgreen, "/bank, /banktele, /neon, /lshospital, /lsairport, /lspd, /lvbikejump, /lvpyramid, /lvsniperspot, /lvcrane, /makemedrunk");
        SendClientMessage(playerid, lightgreen, "/exitrace, /joinrace, /setplate, /findcar, /lock, /sellcarto, /housemenu, /afk, /back, /rob, /rape, /cureme, /hit, /hits, /cure");
        SendClientMessage(playerid, lightgreen, "*RCON ONLY* /healme, /createhouse, /buildrace, /startrace, /stoprace, /ghcmds, /cage");
		return 1;
	}
}

public OnPlayerDisconnect(playerid)
{
	SendClientMessageToAll(orange, "A player has disconnected from the server.");
	return 1;
}

public OnPlayerConnect(playerid)
{
	SendClientMessageToAll(lightgreen, "A player has connected to the server.");
	return 1;
}

	if(!strcmp(cmdtext, "/healme", true, 7))
	{
	    if(IsPlayerAdmin(playerid))
	    SetPlayerHealth(playerid, 100)
	    SetPlayerArmour(playerid, 100)
		SendClientMessage(playerid, blue, "You have restored your Health and Armour.");
		return 1;
	}

public OnPlayerSpawn(playerid)
{
	GivePlayerMoney(playerid, 600000)
	SendClientMessage(playerid, blue, "You have recieved 600k cash for spawning.");
	return 1;
}
	if(!strcmp(cmdtext, "/rules", true, 6))
	{
		SendClientMessage(playerid, orange, "NO DEATH-MATCHING! Respect other players. Be nice to admins (We don't have to let you play ;D)");
 		SendClientMessage(playerid, orange, "Please don't swear excessively. Cheats ARE allowed, but in moderation. Have Fun!!!");
  		return 1;
	}

	if (strcmp(cmdtext, "/makemedrunk", true) == 0)
{
    SetPlayerDrunkLevel (playerid, 50000);
    SendClientMessage(playerid, blue, "You are now drunk, don't drink and drive!");
    return 1;
}
Код:
C:\Users\Noah\Desktop\Snowy server\filterscripts\cmds.pwn(19) : warning 209: function "OnPlayerCommandText" should return a value
C:\Users\Noah\Desktop\Snowy server\filterscripts\cmds.pwn(33) : error 010: invalid function or declaration
C:\Users\Noah\Desktop\Snowy server\filterscripts\cmds.pwn(35) : error 010: invalid function or declaration
C:\Users\Noah\Desktop\Snowy server\filterscripts\cmds.pwn(39) : error 010: invalid function or declaration
C:\Users\Noah\Desktop\Snowy server\filterscripts\cmds.pwn(45) : error 001: expected token: ";", but found "-identifier-"
C:\Users\Noah\Desktop\Snowy server\filterscripts\cmds.pwn(48) : error 010: invalid function or declaration
C:\Users\Noah\Desktop\Snowy server\filterscripts\cmds.pwn(52) : error 010: invalid function or declaration
C:\Users\Noah\Desktop\Snowy server\filterscripts\cmds.pwn(55) : error 010: invalid function or declaration
C:\Users\Noah\Desktop\Snowy server\filterscripts\cmds.pwn(59) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


8 Errors.
?? I don't see anything wrong where the errors are..
Reply
#2

if(!strcmp(cmdtext, "/healme", true, 7))
{
if(IsPlayerAdmin(playerid))
SetPlayerHealth(playerid, 100)
SetPlayerArmour(playerid, 100)
SendClientMessage(playerid, blue, "You have restored your Health and Armour.");
return 1;
}

should be in OnPlayerCommandText and OnPlayerCommandText should return a value (return 0 and you have put that in the if statement, put it outside.
Reply
#3

Try this:http://pastebin.com/MzqZxtAc

Remeber to keep all commands under/at the
Код:
public OnPlayerCommandText(playerid,cmdtext[])
Let me know if it works or not
Reply
#4

I compiled that RedWolf,
got these errors:

Код:
C:\Users\Noah\Desktop\Snowy server\filterscripts\cmds.pwn(27) : error 001: expected token: ";", but found "-identifier-"
C:\Users\Noah\Desktop\Snowy server\filterscripts\cmds.pwn(28) : error 001: expected token: ";", but found "-identifier-"
C:\Users\Noah\Desktop\Snowy server\filterscripts\cmds.pwn(39) : warning 209: function "OnPlayerCommandText" should return a value
C:\Users\Noah\Desktop\Snowy server\filterscripts\cmds.pwn(57) : error 001: expected token: ";", but found "-identifier-"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
Reply
#5

Quote:

if(!strcmp(cmdtext, "/healme", true, 7))
{
if(IsPlayerAdmin(playerid))
SetPlayerHealth(playerid, 100)
SetPlayerArmour(playerid, 100)
SendClientMessage(playerid, blue, "You have restored your Health and Armour.");
return 1;
}

should be in OnPlayerCommandText and OnPlayerCommandText should return a value (return 0 and you have put that in the if statement, put it outside.

Also, thank you for the reply )
Reply
#6

Quote:
Originally Posted by rabexann
Посмотреть сообщение
I compiled that RedWolf,
got these errors:

Код:
C:\Users\Noah\Desktop\Snowy server\filterscripts\cmds.pwn(27) : error 001: expected token: ";", but found "-identifier-"
C:\Users\Noah\Desktop\Snowy server\filterscripts\cmds.pwn(28) : error 001: expected token: ";", but found "-identifier-"
C:\Users\Noah\Desktop\Snowy server\filterscripts\cmds.pwn(39) : warning 209: function "OnPlayerCommandText" should return a value
C:\Users\Noah\Desktop\Snowy server\filterscripts\cmds.pwn(57) : error 001: expected token: ";", but found "-identifier-"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
Will try to fix that, Been a long time since I touched pawno.
I will get back to you when I finished it.

EDIT:

Try this now:http://pastebin.com/4BA4umaH

Compiled it and got no errors. Just write a PM if you need anything else
Reply
#7

Thanks! Much appreciated!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)