06.03.2011, 18:03
im getting problems with dini cause when player disconnect and come back, they spawn at some on top ls, please help how to save player pos when they connect!!!!!!!
Float:pPosX,
Float:pPosY,
Float:pPosZ,
pInfo[playerid][pPosX] = dini_Float(File, "PosX");
pInfo[playerid][pPosY] = dini_Float(File, "PosY");
pInfo[playerid][pPosZ] = dini_Float(File, "PosZ");
SetSpawnInfo(playerid, 0, pInfo[playerid][pSkin],pInfo[playerid][pPosX],pInfo[playerid][pPosY],pInfo[playerid][pPosZ],0,0,0,0,0,0,0);
SpawnPlayer(playerid);
GetPlayerPos(playerid, pInfo[playerid][pPosX], pInfo[playerid][pPosY], pInfo[playerid][pPosZ]);
dini_FloatSet(File, "PosX", pInfo[playerid][pPosX]);
dini_FloatSet(File, "PosY", pInfo[playerid][pPosY]);
dini_FloatSet(File, "PosZ", pInfo[playerid][pPosZ]);
D:\Users\Tanush\Desktop\SA-MP\gamemodes\Server.pwn(1069) : warning 202: number of arguments does not match definition
D:\Users\Tanush\Desktop\SA-MP\gamemodes\Server.pwn(1075) : error 028: invalid subscript (not an array or too many subscripts): "pInfo"
D:\Users\Tanush\Desktop\SA-MP\gamemodes\Server.pwn(1075) : warning 215: expression has no effect
D:\Users\Tanush\Desktop\SA-MP\gamemodes\Server.pwn(1075) : error 001: expected token: ";", but found "]"
D:\Users\Tanush\Desktop\SA-MP\gamemodes\Server.pwn(1075) : error 029: invalid expression, assumed zero
D:\Users\Tanush\Desktop\SA-MP\gamemodes\Server.pwn(1075) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.
pInfo[playerid][pPosX] = dini_Float(File, "PosX");
SetPlayerPosition(playerid, dini_Int(file, "PositionX"));
SetPlayerPosition(playerid, dini_Int(file, "PositionY"));
SetPlayerPosition(playerid, dini_Int(file, "PositionZ"));
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
dini_FloatSet(file, "PositionX", x);
dini_FloatSet(file, "PositionY", y);
dini_FloatSet(file, "PositionZ", z);
new position[MAX_PLAYERS];
stock GetPlayerPosition(playerid)
{
return position[playerid];
}
stock SetPlayerPosition(playerid, pos)
{
position[playerid] = position[playerid] + pos;
return position[playerid];
}