1
ShowRoom (pawn) / Re: Vehicle System
« on: February 13, 2013, 02:15:09 pm »
Oks pero espero que no tardes mucho oks si lo haces en filterscript el sistema ya estara completo
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
[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
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....
BE PATIENCE ! Don't double post !
Passed just 40 minutes.
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;
}
gups 1.1 contain many bugs example /c register
but this is the solution
[pawn]
if ( strcmp( cmd, "registrar", true ) == 0 )
{
tmp = strtok( cmdtext, idx );
if ( !strlen( tmp ) ) SendClientMessage( playerid, COLOR_GREEN, "Escribe: /c registrar [clave]" );
else if ( IsLoggedIn( playerid ) ) SendClientMessage( playerid, RED, "Error: Ya estas registrado." );
else if (PlayerLevel(playerid) >= 1) SendClientMessage(playerid, RED,"Este Nick-name ya esta registrado");// here is the solution FOR NOT register in the same count
else
{
format( file, sizeof( file ), USERS_FILE, gPlayers[ playerid ] );
new string[ 24 ], IP[ 24 ], szMsg[ 128 ];
GetPlayerIp( playerid, IP, 24 );
format( string, 24, "%s", IP );
dini_Create( file );
dini_Set( file, "Password", encrypt( tmp ) );
dini_Set( file, "Login", "1" );
dini_Set( file, "Bank", "0" );
dini_Set( file, "Cash", "0" );
dini_Set( file, "Level", "1" );
dini_Set( file, "Stats", "1" );
dini_Set( file, "Ip", string );
GameTextForPlayer( playerid, "Registro Completo");
SendClientMessage( playerid, COLOR_GREEN, "Te has registrado exitosamente." );
format( szMsg, sizeof( szMsg ), "Tu clave:[ %s ] Tu Nivel: [ 1 ]", tmp, IP );
SendClientMessage( playerid, RED, szMsg );
SendClientMessage( playerid, COLOR_GREEN, "Para ver los comandos usa !Comandos" );
PlayerInfo[ playerid ][ Logged ] = 1;
PlayerInfo[ playerid ][ Level ] = 1;
PlayerInfo[ playerid ][ Stats ] = 1;
}
return 1;
}[/pawn]
Sorry my languaje is spanish xD but i show the bug xD