SA-MP Forums Archive
If this already exist then use it problem.. - 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: If this already exist then use it problem.. (/showthread.php?tid=156545)



If this already exist then use it problem.. - Ihsan_Cingisiz - 23.06.2010

Hello, i have a problem i made a position save system with dini
and it saves the position only if your disconnect for the first time
on your new account. So if i /register a new account there is not
a X, Y, Z position in the .ini so i want that the player spawn at airport
but i have a problem here's my script :

Quote:

public OnPlayerSpawn(playerid)
{
if(IsLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_LRED, "** This server requires a login before spawn. ((Kicked))");
Kick(playerid);
return 1;
}
if(IsLogged[playerid] == 1)
{
new playername[24];
GetPlayerName(playerid, playername, sizeof(playername));
new file[64];
format(file, sizeof(file), "eSportsGaming/Users/%s.ini", playername);

new Float:X, Float:Y, Float:Z;
IsLogged[playerid] = 1;
SetPlayerMoney(playerid, dini_Int(file, "Cash"));
PlayerInfo[playerid][AdminLevel] = dini_Int(file, "AdminLevel");
X = dini_Float(file, "PosX");
Y = dini_Float(file, "PosY");
Z = dini_Float(file, "PosZ");
SetPlayerPos(playerid, X, Y, Z);
}
return 1;
}

So it spawns directly the player with the XYZ coordinates which not is in the
ini on the new account i want to make something like if(!x,t,z exist) { SetPlayerPos(sdnskdjsd)) <<< something like this
but i don't know how please help me



Re: If this already exist then use it problem.. - Ihsan_Cingisiz - 23.06.2010

Solved