Und wie sieht es aus mit pMx, pMy, pMz?
Zudem klappt wie gesagt die Abfrage vom Befehl genial nur das Speichern klappt nicht.
So klappt es leider auch nicht. Falls ihr nicht weiter wisst gebe ich mal mehr Informationen
enum pInfo
{
Float:pfx,
Float:pfy,
Float:pfz,
Float:pMx,
Float:pMy,
Float:pMz,
Float:pfx2,
Float:pfy2,
Float:pfz2,
Float:pMx2,
Float:pMy2,
Float:pMz2,
Float:pfx3,
Float:pfy3,
Float:pfz3,
Float:pMx3,
Float:pMy3,
Float:pMz3
}
Function OnPlayerRegister(playerid, password[])
{
if(IsPlayerConnected(playerid))
{
if (hFile)
{
format(var, 32, "VerstecktesKokainX=%d\n",PlayerInfo[playerid][pfx]);fwrite(hFile, var);
format(var, 32, "VerstecktesKokainY=%d\n",PlayerInfo[playerid][pfy]);fwrite(hFile, var);
format(var, 32, "VerstecktesKokainZ=%d\n",PlayerInfo[playerid][pfz]);fwrite(hFile, var);
format(var, 32, "VersteckteMatsX=%d\n",PlayerInfo[playerid][pMx]);fwrite(hFile, var);
format(var, 32, "VersteckteMatsY=%d\n",PlayerInfo[playerid][pMy]);fwrite(hFile, var);
format(var, 32, "VersteckteMatsZ=%d\n",PlayerInfo[playerid][pMz]);fwrite(hFile, var);
format(var, 32, "VerstecktesKokainX2=%d\n",PlayerInfo[playerid][pfx2]);fwrite(hFile, var);
format(var, 32, "VerstecktesKokainY2=%d\n",PlayerInfo[playerid][pfy2]);fwrite(hFile, var);
format(var, 32, "VerstecktesKokainZ2=%d\n",PlayerInfo[playerid][pfz2]);fwrite(hFile, var);
format(var, 32, "VersteckteMatsX2=%d\n",PlayerInfo[playerid][pMx2]);fwrite(hFile, var);
format(var, 32, "VersteckteMatsY2=%d\n",PlayerInfo[playerid][pMy2]);fwrite(hFile, var);
format(var, 32, "VersteckteMatsZ2=%d\n",PlayerInfo[playerid][pMz2]);fwrite(hFile, var);
format(var, 32, "VerstecktesKokainX3=%d\n",PlayerInfo[playerid][pfx3]);fwrite(hFile, var);
format(var, 32, "VerstecktesKokainY3=%d\n",PlayerInfo[playerid][pfy3]);fwrite(hFile, var);
format(var, 32, "VerstecktesKokainZ3=%d\n",PlayerInfo[playerid][pfz3]);fwrite(hFile, var);
format(var, 32, "VersteckteMatsX3=%d\n",PlayerInfo[playerid][pMx3]);fwrite(hFile, var);
format(var, 32, "VersteckteMatsY3=%d\n",PlayerInfo[playerid][pMy3]);fwrite(hFile, var);
format(var, 32, "VersteckteMatsZ3=%d\n",PlayerInfo[playerid][pMz3]);fwrite(hFile, var);
}
}
}
Function PlayerUpdate(playerid)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid])
{
if (hFile)
{
format(var, 32, "VerstecktesKokainX=%d\n",PlayerInfo[playerid][pfx]);fwrite(hFile, var);
format(var, 32, "VerstecktesKokainY=%d\n",PlayerInfo[playerid][pfy]);fwrite(hFile, var);
format(var, 32, "VerstecktesKokainZ=%d\n",PlayerInfo[playerid][pfz]);fwrite(hFile, var);
format(var, 32, "VersteckteMatsX=%d\n",PlayerInfo[playerid][pMx]);fwrite(hFile, var);
format(var, 32, "VersteckteMatsY=%d\n",PlayerInfo[playerid][pMy]);fwrite(hFile, var);
format(var, 32, "VersteckteMatsZ=%d\n",PlayerInfo[playerid][pMz]);fwrite(hFile, var);
format(var, 32, "VerstecktesKokainX2=%d\n",PlayerInfo[playerid][pfx2]);fwrite(hFile, var);
format(var, 32, "VerstecktesKokainY2=%d\n",PlayerInfo[playerid][pfy2]);fwrite(hFile, var);
format(var, 32, "VerstecktesKokainZ2=%d\n",PlayerInfo[playerid][pfz2]);fwrite(hFile, var);
format(var, 32, "VersteckteMatsX2=%d\n",PlayerInfo[playerid][pMx2]);fwrite(hFile, var);
format(var, 32, "VersteckteMatsY2=%d\n",PlayerInfo[playerid][pMy2]);fwrite(hFile, var);
format(var, 32, "VersteckteMatsZ2=%d\n",PlayerInfo[playerid][pMz2]);fwrite(hFile, var);
format(var, 32, "VerstecktesKokainX3=%d\n",PlayerInfo[playerid][pfx3]);fwrite(hFile, var);
format(var, 32, "VerstecktesKokainY3=%d\n",PlayerInfo[playerid][pfy3]);fwrite(hFile, var);
format(var, 32, "VerstecktesKokainZ3=%d\n",PlayerInfo[playerid][pfz3]);fwrite(hFile, var);
format(var, 32, "VersteckteMatsX3=%d\n",PlayerInfo[playerid][pMx3]);fwrite(hFile, var);
format(var, 32, "VersteckteMatsY3=%d\n",PlayerInfo[playerid][pMy3]);fwrite(hFile, var);
format(var, 32, "VersteckteMatsZ3=%d\n",PlayerInfo[playerid][pMz3]);fwrite(hFile, var);
}
}
}
}
Function OnPlayerLogin(playerid,password[])
{
if ( UserFile )
{
if(strcmp(PlayerInfo[playerid][pKey],password, true ) == 0 )
{
while ( fread( UserFile , Data , sizeof( Data ) ) )
{
if( strcmp( key , "VerstecktesKokainX" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pfx] = strval( val ); }
if( strcmp( key , "VerstecktesKokainY" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pfy] = strval( val ); }
if( strcmp( key , "VerstecktesKokainZ" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pfz] = strval( val ); }
if( strcmp( key , "VersteckteMatsX2" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pMx2] = strval( val ); }
if( strcmp( key , "VersteckteMatsY2" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pMy2] = strval( val ); }
if( strcmp( key , "VersteckteMatsZ2" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pMz2] = strval( val ); }
if( strcmp( key , "VerstecktesKokainX2" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pfx2] = strval( val ); }
if( strcmp( key , "VerstecktesKokainY2" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pfy2] = strval( val ); }
if( strcmp( key , "VerstecktesKokainZ2" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pfz2] = strval( val ); }
if( strcmp( key , "VersteckteMatsX3" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pMx3] = strval( val ); }
if( strcmp( key , "VersteckteMatsY3" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pMy3] = strval( val ); }
if( strcmp( key , "VersteckteMatsZ3" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pMz3] = strval( val ); }
if( strcmp( key , "VerstecktesKokainX3" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pfx3] = strval( val ); }
if( strcmp( key , "VerstecktesKokainY3" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pfy3] = strval( val ); }
if( strcmp( key , "VerstecktesKokainZ3" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pfz3] = strval( val ); }
}
}
}
}
if(strcmp(cmdtext, "/dverstecken10" , true) == 0)
{
if(IsPlayerConnected(playerid))
{
for(new i = 0; i < sizeof(HouseInfo); i++)
{
new location = PlayerInfo[playerid][pLocal];
if(location < 255)
{
if(PlayerInfo[playerid][pDrugs] > 9)
{
new Float:dx,Float:dy,Float:dz;
PlayerInfo[playerid][pDrugs] -= 10;
PlayerInfo[playerid][Versteck] += 10;
SendClientMessage(playerid,0xFF0000FF,"10 Gramm Kokain versteckt");
GetPlayerPos(playerid,dx,dy,dz);
PlayerInfo[playerid][pfx] = dx;
PlayerInfo[playerid][pfy] = dy;
PlayerInfo[playerid][pfz] = dz;
}
}
}
}
}
if(strcmp(cmdtext, "/dnehmen10" , true) == 0)
{
if(IsPlayerConnected(playerid))
{
new location = PlayerInfo[playerid][pLocal];
if(IsPlayerInRangeOfPoint(playerid,10,PlayerInfo[playerid][pfx],PlayerInfo[playerid][pfy],PlayerInfo[playerid][pfz]))
{
if(location < 255)
{
if(PlayerInfo[playerid][Versteck] > 9)
{
PlayerInfo[playerid][pDrugs] += 10;
PlayerInfo[playerid][Versteck] -= 10;
SendClientMessage(playerid,0xFF0000FF,"10 Gramm Kokain genommen");
}
else
{
SendClientMessage(playerid,0xFF0000FF,"Du hast hier nicht genug Kokain");
}
}
}
else
{
SendClientMessage(playerid,0xFF0000FF,"Hier hast du nichts versteckt");
}
}
}
Und nach Relogg kommt immer "Hier hast du nichts versteckt".