Bonjour à tous,j'ai un problème concernant l'achat de véhicule(le systeme de GodFather).
Avant,quand je faisait la commande pour acheter la voiture,par exemple une elegant,eh ben quand je fait la commande pour voir mon manuel il me dit que je possède une "Savanna".
A note,que,la Savanna possède l'id 1(véhicule)et est la première de ma liste de véhicule de vente libre.
Donc j'ai essayé comme ceci en reprenant un système de vente appars :
enum cInfo
{
cModel,
Float:cLocationx,
Float:cLocationy,
Float:cLocationz,
Float:cAngle,
cColorOne,
cColorTwo,
cOwner[MAX_PLAYER_NAME],
cDescription[MAX_PLAYER_NAME],
cValue,
cLicense,
cRegistration,
cOwned,
cLock,
ownedvehicle,
};
La commande.
if(strcmp(cmd, "/acheterv", true) == 0)
{
new vehid = GetPlayerVehicleID(playerid);
if(IsPlayerConnected(playerid))
{
for(new h = 1; h < sizeof(CarInfo); h++)
{
if(IsAnOwnableCar(h)&& CarInfo[h][ownedvehicle] == vehid)
{
if(PlayerInfo[playerid][pPcarkey] != 999 && strcmp(playername, CarInfo[PlayerInfo[playerid][pPcarkey]][cOwner], true) == 0)
{
SendClientMessage(playerid, COLOR_WHITE, "SERVER: Tu possède déjà une voiture.");
return 1;
//return 1;
}
if(CarInfo[h][cOwned]==1)
{
SendClientMessage(playerid, COLOR_GREY, "Quelqu'un possède déjà cette bagnole!");
return 1;
}
if(GetPlayerMoney(playerid) >= CarInfo[h][cValue])
{
PlayerInfo[playerid][pPcarkey] = h;
CarInfo[h][cOwned] = 1;
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(CarInfo[h][cOwner], sendername, 0, strlen(sendername), 999);
GivePlayerMoney(playerid,-CarInfo[h][cValue]);
PlayerPlayMusic(playerid);
GameTextForPlayer(playerid, "~w~Felicitatiiions~n~!", 5000, 3);
SendClientMessage(playerid, COLOR_GRAD2, "Félicitations pour votre nouvelle achat!");
SendClientMessage(playerid, COLOR_GRAD2, "Tape /manuel pour voir le manuel!");
DateProp(playerid);
OnPropUpdate();
OnPlayerUpdate(playerid);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Tu n'as pas assez!");
return 1;
}
}
}
return 1;
}
}
J'ai ajouté "new vehid = GetPlayerVehicleID(playerid);" , reprendre l'identifiant du véhicule qui pourrat me servir pour l'achat.
Mais,maintenant,la commande n'as pas d'effets,rien ne s'affiche,rien ne se produits.
Merci de votre aide (Si des personnes ont du mal avec les codes,je peut les mettres en pastebins)
Tranced.