[REQUEST] Position save
#1

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...
Reply
#2

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;
}
Reply
#3

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

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
Reply
#5

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

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
Reply
#7

Just wondering what you have under new Float:gRandomPlayerSpawns
Reply
#8

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

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.



Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)