27.05.2014, 11:57
Hello.I have problem with selling a car to player.When i sell to him and he accept the request and the car is mine again ... And i can type /vozilo its on macedonian language but its /car command and i can type /car he can't type /car but i sell the car to him and not working :/ why ?? but text is working perfectly ... Repping Thanks but fast please if is possible Thanks
Thanks
that is /vozilo command (/car)
PlayerOwnedVehID
pawn Код:
if(dialogid == DIALOG_APPONUDA)
{
new i;
new TCID, TCID1;
new sendername[MAX_PLAYER_NAME];
new prodaznovozilo = GetPlayerVehicleID(playerid);
GetPlayerName(playerid, sendername, sizeof(sendername));
i = ConvertVehIDtoDYID(prodaznovozilo);
if(!response)
{
SCMF(ProdavacAvtomobil[playerid],BELA,"{739EFA}%s ja odbi ponudata da go kupi vasiot Avtomobil",GetName(playerid));
SCMF(playerid,BELA,"{739EFA}Ja odbivte ponudata da go kupite avtomobilot na %s",GetName(ProdavacAvtomobil[playerid]));
CenaAvtomobil[playerid] = 0;
IDavtomobil[playerid] = 0;
IgracKProdajesA[ProdavacAvtomobil[playerid]] = 0;
ProdavacAvtomobil[playerid] = 0;
}
else
{
TCID = PlayerOwnedVehID(playerid,prodaznovozilo);
TCID1 = PlayerOwnedVehID(ProdavacAvtomobil[playerid],prodaznovozilo);
if(!ProxDetectorS(5.0,playerid,ProdavacAvtomobil[playerid])) return SCM(playerid,BELA,"{FF4040}GRESKA:{FFFFFF}Gazdata na avtomobilot ne e blisku do vas!");
if(GetPlayerMoney(playerid) < CenaAvtomobil[playerid]) return SCM(playerid,BELA,"{FF4040}GRESKA:{FFFFFF}Nemate dovolno pari za da go kupite ovoj Avtomobil");
if(PlayerInfo[playerid][pLevel] < 5) return SCM(playerid,BELA,"{FF4040}GRESKA:{FFFFFF}Nemate dovolno Level za da kupite Avtomobil (5+)");
GivePlayerMoney(playerid,-CenaAvtomobil[playerid]);
GivePlayerMoney(ProdavacAvtomobil[playerid],CenaAvtomobil[playerid]);
SCMF(playerid, COLOR_WHITE, "{739EFA}Ja prifativte ponudata i go kupivte avtomobilot na %s", GetName(ProdavacAvtomobil[playerid]));
SCMF(ProdavacAvtomobil[playerid], COLOR_WHITE, "{739EFA}%s ja prifati ponudata i go kupi vasiot avtomobil", GetName(playerid));
strmid(MyVehicle[TCID][MyVehOwner], GetName(playerid), 0, strlen(GetName(playerid)), 255);
RemovePlayerFromVehicle(ProdavacAvtomobil[playerid]);
MyVehicle[TCID][MyVehCar] = 1;
OnPlayerUpdate(playerid);
MyVehicle[TCID1][MyVehCar] = -1;
OnPlayerUpdate(ProdavacAvtomobil[playerid]);
MyVehicle[TCID][MyVehLock] = 0;
}
}
that is /vozilo command (/car)
pawn Код:
CMD:vozilo(playerid,params[])
{
new vozilo = GetPlayerVehicleID(playerid);
new cm = AllMyCars(playerid);
if(cm < 0)
{
SendClientMessage(playerid, COLOR_WHITE, "{FF4040}GRESKA:{FFFFFF}Ne poseduvate vozilo");
return 1;
}
if(PlayerOwnedVehID(playerid,vozilo) != -1)
{
ShowPlayerDialog(playerid,AVTOMENI, DIALOG_STYLE_LIST,"{FF4040}°{739EFA} Avtomobil Meni {FF4040}°","{FF4040}» {739EFA}Otkluci\n{FF4040}» {739EFA}Zakluci\n{FF4040}» {739EFA}Parkiraj\n{FF4040}» {739EFA}Registriraj\n{FF4040}» {739EFA}Lociraj\n{FF4040}» {739EFA}Prodadi\n{FF4040}» {739EFA}Prodadi na Igrac","Odberi","Otkazi");
}
else
{
ShowPlayerDialog(playerid,AVTOMENI1, DIALOG_STYLE_LIST, "{FF4040}°{739EFA} Avtomobil Meni {FF4040}°","{FF4040}» {739EFA}Pronajdi Avtomobil","Odberi","Otkazi");
return 1;
}
return 1;
}
pawn Код:
stock PlayerOwnedVehID(playerid,vehicleid)
{
new ime[MAX_PLAYER_NAME];
GetPlayerName(playerid,ime,sizeof(ime));
for(new i = 0; i < sizeof(MyVehicle); i++)
{
if(MyVehicle[i][MyVehSlot] == 1 && MyVehicle[i][MyVehID] == vehicleid)
{
if (strmatch(MyVehicle[i][MyVehOwner], ime))return i;
}
}
return -1;
}