check if file exist cmds not working - 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: check if file exist cmds not working (
/showthread.php?tid=261622)
check if file exist cmds not working -
krisis32 - 14.06.2011
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;
}