SA-MP Forums Archive
[Ajuda] Salvar posiзгo do carro em DOF2 - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Salvar posiзгo do carro em DOF2 (/showthread.php?tid=438873)



Salvar posiзгo do carro em DOF2 - Lessk - 22.05.2013

Alguйm poderia me ajudar com esse cуdigo? Tentei de tudo mas, sempre salva como: 0.0000.... (x,y,z)
@edit: cуdigo
Код:
    if(strcmp(cmd, "/estacionar", true) == 0)//FFFF00 
    {    
          new car;
          new Float:angle;          
          new Float:vehx, Float:vehy, Float:vehz;           
          new color1, color2;
          new arq[50]; 
          format(arq,sizeof arq,"Contas/%s.ini",Nome(playerid));                
          GetVehiclePos(car, vehx, vehy, vehz); 
          car = GetPlayerVehicleID(playerid);
          GetVehicleZAngle(car, angle);
          GetVehicleColor(car, color1, color2);         

          PlayerInfo[playerid][pModelid] = GetVehicleModel(car);        
          //PlayerInfo[playerid][SpawnX] = vehx;          
          //PlayerInfo[playerid][SpawnY] = vehy;          
          //PlayerInfo[playerid][SpawnZ] = vehz;          
          //PlayerInfo[playerid][Angle] = angle;
          DOF2_SetFloat(arq,"SpawnX",vehx);
          DOF2_SetFloat(arq,"SpawnY",vehy);
          DOF2_SetFloat(arq,"SpawnZ",vehz);
          DOF2_SetFloat(arq,"Angle",angle);                    
          PlayerInfo[playerid][pColor1] = color1;          
          PlayerInfo[playerid][pColor2] = color2;
          return 1;	
    }



Re: Salvar posiзгo do carro em DOF2 - Caio_Freeze - 22.05.2013

tenta assim:

pawn Код:
if(strcmp(cmd, "/estacionar", true) == 0)//FFFF00
    {    
          new car;
          new Float:angle;          
          new Float:vehx, Float:vehy, Float:vehz;          
          new color1, color2;
          new arq[50];
          format(arq,sizeof arq,"Contas/%s.ini",Nome(playerid));                
          GetVehiclePos(car, vehx, vehy, vehz);
          car = GetPlayerVehicleID(playerid);
          GetVehicleZAngle(car, angle);
          GetVehicleColor(car, color1, color2);        
          PlayerInfo[playerid][pModelid] = GetVehicleModel(car);        
          PlayerInfo[playerid][SpawnX] = vehx;          
          PlayerInfo[playerid][SpawnY] = vehy;          
          PlayerInfo[playerid][SpawnZ] = vehz;          
          PlayerInfo[playerid][Angle] = angle;
          DOF2_SetFloat(arq,"SpawnX",vehx);
          DOF2_SetFloat(arq,"SpawnY",vehy);
          DOF2_SetFloat(arq,"SpawnZ",vehz);
          DOF2_SetFloat(arq,"Angle",angle);                    
          PlayerInfo[playerid][pColor1] = color1;          
          PlayerInfo[playerid][pColor2] = color2;
          return 1;
    }



Re: Salvar posiзгo do carro em DOF2 - mau.tito - 22.05.2013

pawn Код:
if(strcmp(cmd, "/estacionar", true) == 0)//FFFF00
    {
          new car;
          new Float:angle;
          new Float:vehx, Float:vehy, Float:vehz;
          new color1, color2;
          new arq[50];
          format(arq,sizeof arq,"Contas/%s.ini",Nome(playerid));
          GetVehiclePos(car, vehx, vehy, vehz);
          car = GetPlayerVehicleID(playerid);
          GetVehicleZAngle(car, angle);
          GetVehicleColor(car, color1, color2);
          PlayerInfo[playerid][pModelid] = GetVehicleModel(car);
          DOF2_SetFloat(arq,"SpawnX",vehx);
          DOF2_SetFloat(arq,"SpawnY",vehy);
          DOF2_SetFloat(arq,"SpawnZ",vehz);
          DOF2_SetFloat(arq,"Angle",angle);
          DOF2_SetInt(arq,"color1",color1);
          DOF2_SetInt(arq,"color2",color2);
          DOF2_SaveFile();
          return 1;
    }