Vice City Multiplayer

VC:MP 0.3 => mIRC/pawn Scripting => Topic started by: omarlin97 on January 22, 2013, 05:18:36 am

Title: Save Pos
Post by: omarlin97 on January 22, 2013, 05:18:36 am
[pawn]public OnPlayerDisconnect(playerid, reason)
{
if(GetPos(playerid)) return 0;
SetNew(playerid,1);
   return 1;
}[/pawn]
[pawn]public OnPlayerSpawn(playerid,classid,teamid)
{
    new gpX = dini_Int( file, "PosX" ), gpY = dini_Int( file, "PosY" ), gpZ = dini_Int( file, "PosZ" );
if(GetNew(playerid) == 1) {
SetPlayerPos(playerid,gpX,gpY,gpZ,0,0);
}
if(GetNew(playerid) == 0) {
}
   return 1;
}[/pawn]

Code: [Select]
public GetNew(playerid)
{
format(MSN,256, REGISTERS, gPlayers[playerid]);
new n; n = dini_Int(MSN,"New");
return n;
}
public SetNew(playerid,Monto)
{
format(MSN,256, REGISTERS, gPlayers[playerid]);
dini_IntSet(MSN,"New",Monto);
}
public GetPos(playerid)
{
format(MSN,256, REGISTERS, gPlayers[playerid]);
new Float:gpX,Float:gpY,Float:gpZ,str[256],string[256],sz[256];
GetPlayerPos(playerid,gpX,gpY,gpZ);
format(string,sizeof(string),"%.0f",gpX);
format(str,sizeof(str),"%.0f",gpY);
format(sz,sizeof(sz),"%.0f",gpZ);
dini_Set(MSN, "PosX", string);
dini_Set(MSN, "PosY", str);
dini_Set(MSN, "PosZ", sz);
return 0;
}

Because the player does not appear where it's supposed to appear
is like a bug
Title: Re: Save Pos
Post by: omarlin97 on January 22, 2013, 05:57:36 pm
????????????
Title: Re: Save Pos
Post by: sseebbyy on January 22, 2013, 05:59:39 pm
BE PATIENCE ! Don't double post !

Passed just 40 minutes.  ::)
Title: Re: Save Pos
Post by: omarlin97 on January 22, 2013, 06:24:05 pm
BE PATIENCE ! Don't double post !

Passed just 40 minutes.  ::)

Oks Sorry sseebbyy
Title: Re: Save Pos
Post by: sseebbyy on January 23, 2013, 04:15:34 pm
Do you save the position when the player die ? (to can be took data from ini files)

'cause you know... maybe that player left the server when he was on RequestClass. (Im not sure if your pos can be saved when you are at RequestClass location)
Title: Re: Save Pos
Post by: omarlin97 on January 23, 2013, 04:30:17 pm
I mean that the system as it is bugged that sends me to another place
Title: Re: Save Pos
Post by: aledark24 on January 24, 2013, 11:10:31 pm
I mean that the system as it is bugged that sends me to another place

WN con letras grandes.... copias todo lo que usa dilson por eso no te ayuda....

Es facil ver tu problema xD
Title: Re: Save Pos
Post by: NeskWriter on January 24, 2013, 11:23:09 pm
I mean that the system as it is bugged that sends me to another place

WN con letras grandes.... copias todo lo que usa dilson por eso no te ayuda....

Es facil ver tu problema xD

FUCK
CAN
U
SPEAK
ENGLISH???
Title: Re: Save Pos
Post by: omarlin97 on January 25, 2013, 04:00:31 am
I mean that the system as it is bugged that sends me to another place

WN con letras grandes.... copias todo lo que usa dilson por eso no te ayuda....

Es facil ver tu problema xD

Pues Resuelvelo tu idiota :P
Se que lo amas por lo tanto que lo mencionas :D
Title: Re: Save Pos
Post by: aledark24 on January 25, 2013, 06:26:11 pm
[pawn]public OnPlayerDisconnect(playerid, reason)
{
   new file[256];
   format(file, sizeof(file), REGISTERS, gPlayers[playerid]);
    GetPlayerPos(playerid, CoordX[playerid], CoordY[playerid], CoordZ[playerid]);
   
 dini_FloatSet(file, "pY", CoordY[playerid]);
 dini_FloatSet(file, "pZ", CoordZ[playerid]);
 dini_FloatSet(file, "pX", CoordX[playerid]);
     }
   return 1;
}[/pawn]
[pawn]public OnPlayerSpawn(playerid,classid,teamid)
{
SetPlayerPos(playerid, dini_Float(file, "pY"), dini_Float(file, "pX"), dini_Float(file, "pZ"),0,0);
   return 1;
}[/pawn]

[pawn]
new Float:CoordX[MAX_PLAYERS]; // Definicion de la locacion a guardar
new Float:CoordY[MAX_PLAYERS];
new Float:CoordZ[MAX_PLAYERS];
[/pawn]


Prueba aver que tal te funciona //la primera vez que des spawn  apareceras dentro del campo de golf "porke no tiene definida una loc, pero al desconectart te la creara" intenta no desconectarte en el mar o en el aeropuerto porke te manda a otras locs
Title: Re: Save Pos
Post by: omarlin97 on January 25, 2013, 08:53:10 pm
[pawn]public OnPlayerDisconnect(playerid, reason)
{
   new file[256];
   format(file, sizeof(file), REGISTERS, gPlayers[playerid]);
    GetPlayerPos(playerid, CoordX[playerid], CoordY[playerid], CoordZ[playerid]);
   
 dini_FloatSet(file, "pY", CoordY[playerid]);
 dini_FloatSet(file, "pZ", CoordZ[playerid]);
 dini_FloatSet(file, "pX", CoordX[playerid]);
     }
   return 1;
}[/pawn]
[pawn]public OnPlayerSpawn(playerid,classid,teamid)
{
SetPlayerPos(playerid, dini_Float(file, "pY"), dini_Float(file, "pX"), dini_Float(file, "pZ"),0,0);
   return 1;
}[/pawn]

[pawn]
new Float:CoordX[MAX_PLAYERS]; // Definicion de la locacion a guardar
new Float:CoordY[MAX_PLAYERS];
new Float:CoordZ[MAX_PLAYERS];
[/pawn]


Prueba aver que tal te funciona //la primera vez que des spawn  apareceras dentro del campo de golf "porke no tiene definida una loc, pero al desconectart te la creara" intenta no desconectarte en el mar o en el aeropuerto porke te manda a otras locs

Aun Esta Bugged
Title: Re: Save Pos
Post by: aledark24 on January 26, 2013, 10:22:00 pm
solo algunas veces pasa  adwmas hasta en la wea de lvr se bugueaba y te tiraba dl cielo aveces
Title: Re: Save Pos
Post by: omarlin97 on January 27, 2013, 03:51:56 am
Rayos necesito a alguien que me ayude a solucionar eso
Title: Re: Save Pos
Post by: stormeus on January 28, 2013, 10:58:22 pm
If you noticed that any of your posts have been deleted, you were either flaming or off-topic. Do not flame others. It is a basic rule. Some people whose posts were removed have already been warned for it.

If you are going to attack people and assert your alleged self-importance by calling yourself the greatest scripter on this planet and everyone else gay, you have been warned. If you continue, your punishments will become harsher.

Now stay on topic and answer the question in the OP.