31.01.2015, 20:08
Well you can't just use "i" instead of "playerid", you need to define it.
As you see, functions like OnPlayerConnect has a (playerid) parameter, therefore it's already defined.
People often create a loop between all players, and rename the playerid (that it's looping through) to "i", but you cannot do this if you haven't looped through players and defined "i".
As you can see, there's no "playerid" parameter, so you cannot "SetPlayerSkin(playerid".
Also, i don't think OnPlayerConnect is called when a NPC connects to the server, for that you should use OnNPCConnect.
I know you found a fix to all of this, but just an explanation so you know why these problems occured.
As you see, functions like OnPlayerConnect has a (playerid) parameter, therefore it's already defined.
People often create a loop between all players, and rename the playerid (that it's looping through) to "i", but you cannot do this if you haven't looped through players and defined "i".
pawn Код:
public OnFilterScriptInit()
Also, i don't think OnPlayerConnect is called when a NPC connects to the server, for that you should use OnNPCConnect.
I know you found a fix to all of this, but just an explanation so you know why these problems occured.