SA-MP Forums Archive
Can Someone Help Me Resolve This error? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Can Someone Help Me Resolve This error? (/showthread.php?tid=261344)



Can Someone Help Me Resolve This error? - Bmxerlmao5288 - 13.06.2011

The Errors

Код:
C:\Documents and Settings\Administrator\Desktop\New GTA Server\gamemodes\DeathMatch.pwn(192) : error 010: invalid function or declaration
C:\Documents and Settings\Administrator\Desktop\New GTA Server\gamemodes\DeathMatch.pwn(195) : error 010: invalid function or declaration
C:\Documents and Settings\Administrator\Desktop\New GTA Server\gamemodes\DeathMatch.pwn(200) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Documents and Settings\Administrator\Desktop\New GTA Server\gamemodes\DeathMatch.pwn(259) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Documents and Settings\Administrator\Desktop\New GTA Server\gamemodes\DeathMatch.pwn(310) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Documents and Settings\Administrator\Desktop\New GTA Server\gamemodes\DeathMatch.pwn(925) : warning 203: symbol is never used: "pName"
C:\Documents and Settings\Administrator\Desktop\New GTA Server\gamemodes\DeathMatch.pwn(925) : warning 203: symbol is never used: "string"
The Code

Код:
public OnPlayerConnect(playerid)
{
    AFKS[playerid] = 0;
}
    new string[64], pName[MAX_PLAYER_NAME];
	GetPlayerName,(playerid,pname,MAX_PLAYER_NAME);
    format(string,sizeof string,"%s has joined the server!",pName);
    SendClientMessageToAll(0xFFFFFFAA,string);
	return 1;



Re: Can Someone Help Me Resolve This error? - Benjo - 13.06.2011

I think you just need to move the } down to the bottom like this:
pawn Код:
public OnPlayerConnect(playerid)
{
    AFKS[playerid] = 0;

    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName,(playerid,pname,MAX_PLAYER_NAME);
    format(string,sizeof string,"%s has joined the server!",pName);
    SendClientMessageToAll(0xFFFFFFAA,string);
    return 1;
}