Help me with this: invalid function or declaration
#1

Код:
C:\Users\NoConviction\Desktop\VG\gamemodes\HRP_9.0.pwn(60249) : error 010: invalid function or declaration
C:\Users\NoConviction\Desktop\VG\gamemodes\HRP_9.0.pwn(60251) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.


Код:
forward OnPlayerModelSelection(playerid, response, listid, modelid);
public OnPlayerModelSelection(playerid, response, listid, modelid){
{
	if(listid == DUTYSKINS)
	{
	    if(response)
	    {
    		SetPlayerSkin(playerid, modelid);
   		}
	}
}
	if(listid == UNDERCOVERSKINS)
	{
	    if(response)
	    {
    		SetPlayerSkin(playerid, modelid);
   		}
	}
}
	if(listid == FDUTYSKINS)
	{
	    if(response)
	    {
	        SetPlayerSkin(playerid, modelid);
		}
	}
}
What's wrong with this (Last lines)
Reply
#2

Your braces don't match up. The opening brace I marked in ORANGE has a closing brace I marked in RED and the last lines are below that closing brace and thus outside the callback and thus invalid.
Код:
forward OnPlayerModelSelection(playerid, response, listid, modelid);
public OnPlayerModelSelection(playerid, response, listid, modelid){
{
	if(listid == DUTYSKINS)
	{
	    if(response)
	    {
    		SetPlayerSkin(playerid, modelid);
   		}
	}
}
	if(listid == UNDERCOVERSKINS)
	{
	    if(response)
	    {
    		SetPlayerSkin(playerid, modelid);
   		}
	}
}
	if(listid == FDUTYSKINS)
	{
	    if(response)
	    {
	        SetPlayerSkin(playerid, modelid);
		}
	}
}
Solution: remove the red brace. The blue braces, while valid code, serve no purpose and can also be removed.
Reply
#3

FIXED ! Thank you very much And +1 rep for you !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)