Last place
#6

PHP код:
enum PlayerPos
{
    
X
    
Y,
    
Z
}
new 
ppos[MAX_PLAYERS][PlayerPos];
forward playerpos_tag(playeridname[], value[]);
public 
playerpos_tag(playeridname[], value[])
{
    
INI_Float("X"ppos[playerid][X]);
    
INI_Float("Y"ppos[playerid][Y]);
    
INI_Float("Z"ppos[playerid][Z]);
    return 
1;
}
public 
OnPlayerDisconnect(playerid)
{
    new 
Float:xFloat:yFloat:z;
    
GetPlayerPos(playeridxyz);
    new 
str[35], pname[24];
    
GetPlayerName(playeridpnamesizeof(pname));
    
format(strsizeof(str), "pos/%s.ini"pname);
    new 
INI:file fopen(str);
    
INI_WriteFloat(file"X"x);
    
INI_WriteFloat(file"Y"y);
    
INI_WriteFloat(file"Z"z);
    
INI_Close(file);
    return 
1;
}
public 
OnPlayerSpawn(playerid)
{
    new 
str[35], pname[24];
    
GetPlayerName(playeridpnamesizeof(pname));
    
format(strsizeof(str), "pos/%s.ini"pname);
    
INI_ParseFile(str"playerpos_%s", .bExtra true, .extra playerid);
    
SetPlayerPos(playeridppos[playerid][X], ppos[playerid][Y], ppos[playerid][Z]);
    return 
1;

And last:
create folder in scriptfiles and name it pos
Reply


Messages In This Thread
Last place - by GreatLouis - 09.08.2016, 07:12
Re: Last place - by Himan - 09.08.2016, 07:34
Re: Last place - by LifeRah - 09.08.2016, 07:42
Re: Last place - by Whatname - 09.08.2016, 07:46
Re: Last place - by GreatLouis - 09.08.2016, 07:46
Re: Last place - by Whatname - 09.08.2016, 08:00
Re: Last place - by GreatLouis - 09.08.2016, 08:07
Re: Last place - by Whatname - 09.08.2016, 08:09
Re: Last place - by GreatLouis - 09.08.2016, 08:20
Re: Last place - by Whatname - 09.08.2016, 08:27

Forum Jump:


Users browsing this thread: 2 Guest(s)