SA-MP Forums Archive
[REQUEST] Position save - 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: [REQUEST] Position save (/showthread.php?tid=87692)



[REQUEST] Position save - Ray.Delahunt - 21.07.2009

Hey,

We are scripting our server and now we are stuck on one damn part of the script. We want system that saves player position on Loging off or crash. So next time the player logs back in, hes back at the place he Loged off.

It would be VERY helpfun if someone could help.

Thanks...


Re: [REQUEST] Position save - James_Alex - 21.07.2009

use dini include
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
  new str[256], plname[MAX_PLAYER_NAME];
  GetPlayerName(playerid, plname, sizeof(plname));
  format(str, sizeof(str), "%s.ini", plname);  
  new Float:X, Y, Z;
  GetPlayerPos(playerid, X, Y, Z);
  dini_FloatSet(str, "X", X);
  dini_FloatSet(str, "Y", Y);
  dini_FloatSet(str, "Z", Z);
  return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
  new str[256], plname[MAX_PLAYER_NAME];
  GetPlayerName(playerid, plname, sizeof(plname));
  format(str, sizeof(str), "%s.ini", plname);    
  GetPlayerPos(playerid, dini_Float(str, "X"), dini_Float(str, "Y"), dini_Float(str, "Z"));
  return 1;
}



Re: [REQUEST] Position save - Ray.Delahunt - 21.07.2009

So This should do it right? Its for RP server...
I will test it as soon as i can.
Thanks man, your a genious.


Re: [REQUEST] Position save - James_Alex - 21.07.2009

Quote:
Originally Posted by Ray.Delahunt
So This should do it right? Its for RP server...

Thanks man, your a genious.
yes it's right


Re: [REQUEST] Position save - Jamould - 21.07.2009

Just wondering what gamemode it is. There are plenty of filterscripts that do this as well


Re: [REQUEST] Position save - Ray.Delahunt - 21.07.2009

I think its Classic GF gamemode... The spawns there are determined by players class and I dont need it.
Anyway, I got another request for help. We need Weapon sawe system. I really dont know why its not working but, its not. So Simple Weapon sawe systen is needed, so after loging your weapons save.

Huge thanks to you all- Scripter pros


Re: [REQUEST] Position save - Jamould - 21.07.2009

Just wondering what you have under new Float:gRandomPlayerSpawns


Re: [REQUEST] Position save - Ray.Delahunt - 22.07.2009

Quote:
Originally Posted by Jamould
Just wondering what you have under new Float:gRandomPlayerSpawns
Dont really know...


Re: [REQUEST] Position save - Mauka4 - 23.07.2009

When i compile i have some errors


D:\Games\GTA San Andreas\NEW SERVERIS\pawno\include\dutils.inc(22) : error 017: undefined symbol "MAX_PLAYERS"
D:\Games\GTA San Andreas\NEW SERVERIS\pawno\include\dutils.inc(233) : error 017: undefined symbol "fexist"
D:\Games\GTA San Andreas\NEW SERVERIS\pawno\include\dutils.inc(233) : warning 215: expression has no effect
D:\Games\GTA San Andreas\NEW SERVERIS\pawno\include\dutils.inc(233) : error 001: expected token: ";", but found ")"
D:\Games\GTA San Andreas\NEW SERVERIS\pawno\include\dutils.inc(233) : error 029: invalid expression, assumed zero
D:\Games\GTA San Andreas\NEW SERVERIS\pawno\include\dutils.inc(233) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


5 Errors.