check if file exist cmds not working
#1

When i have this code in my script, no cmds work.
Code have to check if a file in players/ folder exist. If it exist, then take position of last saved player pos. If the file doesnt exist, then put player to skin 26 and give welcome messege!

Код:
public OnPlayerSpawn(playerid)
{
    new player[MAX_PLAYER_NAME];
    GetPlayerName(playerid, player, sizeof(player));
    new filename[8];
    format(filename, 8, "pp/%s.ini");
    if(fexist(filename))
    {
    SetPlayerPos(playerid,positionx,positiony,positionz);
    }
    else
    {
    SetPlayerSkin(playerid, 26);
    SendClientMessage(playerid, COLOR_WHITE, "Welcome new player!");
    }

    SetPlayerToTeamColour(playerid);
    TextDrawHideForPlayer(playerid, gTextDraw);

	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)