Könnte mir wer helfen???
hir dir Codes:
enum pInfo
{
Float:pX,Float:pY,Float:pZ,Float:pA,
pFarbe1,pFarbe2,pKey,pModel,pPreis,
pOwner[MAX_PLAYER_NAME],pCheck
};
new PlayerInfo[MAX_PLAYERS][pInfo];
new cmd[256], idx, string[256];
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, "/sellcar", true) == 0)
{
if(PlayerInfo[playerid][pKey] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED,"Du besitzt noch kein Auto !");
if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pKey])
{
new str[128];
new Float: X, Float: Y, Float: Z, Float: A;
GetVehiclePos(GetPlayerVehicleID(playerid), X, Y, Z);
GetVehicleZAngle(GetPlayerVehicleID(playerid), A);
PlayerInfo[playerid][pX] = 0;
PlayerInfo[playerid][pY] = 0;
PlayerInfo[playerid][pZ] = 0;
PlayerInfo[playerid][pA] = 0;
PlayerInfo[playerid][pModel] = 0;
PlayerInfo[playerid][pFarbe1] = 0;
PlayerInfo[playerid][pFarbe2] = 0;
DeleteVehicle(playerid);
DestroyVehicle(GetPlayerVehicleID(playerid));
PlayerInfo[playerid][pKey] = 0;
GivePlayerMoney(playerid, PlayerInfo[playerid][pPreis]/2);
PlayerInfo[playerid][pPreis] = 0;
format(str, sizeof(str),"Du hast dein Fahrzeug erfolgreich für %d$ verkauft.",pPreis);
SendClientMessage(playerid, COLOR_LIGHTBLUE,str);
return 1;
}
else
{
return SendClientMessage(playerid, COLOR_LIGHTRED,"Dieses Auto gehört nicht dir !");
}
}
stock LoadVehicels(playerid)
{
new arrCoords[30][64];
new strFromFile2[256];
new string[256], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string),"/Autohaus/%s.ini",name);
if(!fexist(string)) return 1;
new File: file = fopen(string, io_read);
if (file)
{
fread(file, strFromFile2);
split(strFromFile2, arrCoords, ',');
PlayerInfo[playerid][pX] = floatstr(arrCoords[0]);
PlayerInfo[playerid][pY] = floatstr(arrCoords[1]);
PlayerInfo[playerid][pZ] = floatstr(arrCoords[2]);
PlayerInfo[playerid][pA] = floatstr(arrCoords[3]);
PlayerInfo[playerid][pFarbe1] = strval(arrCoords[4]);
PlayerInfo[playerid][pFarbe2] = strval(arrCoords[5]);
PlayerInfo[playerid][pModel] = strval(arrCoords[6]);
PlayerInfo[playerid][pPreis] = strval(arrCoords[7]);
PlayerInfo[playerid][pNitro] = stravl(arrCoords[8]);
PlayerInfo[playerid][pHyd] = stravl(arrCoords[9]);
PlayerInfo[playerid][pWheel] = stravl(arrCoords[10]);
PlayerInfo[playerid][pSpoiler] = stravl(arrCoords[11]);
strmid(PlayerInfo[playerid][pOwner], name, 0, strlen(name), 255);
new str[259];
format(str, sizeof(str),"%s",name);
PlayerInfo[playerid][pKey] = CreateVehicle(PlayerInfo[playerid][pModel],PlayerInfo[playerid][pX],PlayerInfo[playerid][pY],PlayerInfo[playerid][pZ],PlayerInfo[playerid][pA],PlayerInfo[playerid][pFarbe1],PlayerInfo[playerid][pFarbe2],PlayerInfo[playerid][pSpoiler],PlayerInfo[playerid][pNitro],PlayerInfo[playerid][pWheel],PlayerInfo[playerid][pHyd],-1);
SetVehicleNumberPlate(PlayerInfo[playerid][pKey],str);
SetVehicleToRespawn(PlayerInfo[playerid][pKey]);
fclose(file);
}
return 1;
}
stock SaveVehicles(string[],playerid)
{
new entry[256],str[256],name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(str, sizeof(str),"/Autohaus/%s.ini",name);
format(entry, sizeof(entry), "%s\n",string);
new File:hFile;
hFile = fopen(str, io_write);
fwrite(hFile, entry);
fclose(hFile);
}