Problem: Saving Player Position
#1

Hi guys,

I have made a filterscript called SavePos and everything works fine excepted of that the player spawns the first time random at the world. I don't know how I can make that the player spawns at this coordinates: 2229.0200,-1159.7896,25.7981,90.0000 at the first time. Please help me.

This is my script:

PHP код:
#include <a_samp>
#include <dini>
public OnFilterScriptInit()
{
    print(
"\n--------------------------------------");
    print(
" SavePos Filterscript");
    print(
"--------------------------------------\n");
    return 
1;
}
public 
OnFilterScriptExit()
{
    return 
1;
}
public 
OnPlayerDisconnect(playeridreason)
{
    new 
file[128], pname[MAX_PLAYER_NAME];
    new 
Float:xFloat:yFloat:z;
    
GetPlayerName(playeridpnamesizeof(pname));
    
format(filesizeof(file), "\\SavePos\\%s.ini"pname);
    if(!
dini_Exists(file))
    
dini_Create(file);
    
GetPlayerPos(playeridxyz);
    
dini_FloatSet(file"posX"x);
    
dini_FloatSet(file"posY"y);
    
dini_FloatSet(file"posZ"z);
    return 
1;
}
public 
OnPlayerSpawn(playerid)
{
    new 
file[128], pname[MAX_PLAYER_NAME];
    new 
Float:xFloat:yFloat:z;
    
GetPlayerName(playeridpnamesizeof(pname));
    
format(filesizeof(file), "\\SavePos\\%s.ini"pname);
    
dini_Float(file"posX");
    
dini_Float(file"posY");
    
dini_Float(file"posZ");
    
SetPlayerPos(playeridxyz);
    return 
1;

Reply


Messages In This Thread
Problem: Saving Player Position - by 7daan71 - 21.06.2012, 14:50
Re: Problem: Saving Player Position - by Jonny5 - 21.06.2012, 14:59
Re: Problem: Saving Player Position - by rachit_rocks - 21.06.2012, 15:04
Re: Problem: Saving Player Position - by Jonny5 - 21.06.2012, 15:06
Re: Problem: Saving Player Position - by rachit_rocks - 21.06.2012, 15:09
Re: Problem: Saving Player Position - by 7daan71 - 21.06.2012, 17:58

Forum Jump:


Users browsing this thread: 3 Guest(s)