Jump to content
  • 0

Question

Posted

La ma?ini personale atunci când îmi cump?r una Îmi dau lock ?i dup? rr-ul la server numai merge sa o deblochez. Am încercat ?i cu /unlockcars, ?i degeaba. Tot nu se deblocheze, va rog sa m? ajuta?i.

Cel din urma va fi cel dintâi.

2 answers to this question

Recommended Posts

Posted

Da-ne comanda /v buy sau care o ai cand cumperi masina si inca ceva deci cand e de vanzare poti urca in ea si sa o cumperi nu? (si daca e da-ne si comanda de unlock)

Posted

Comanda /buyveh si /sellveh:

[pawn]if (strcmp(cmd, "/buyveh", true) ==0 )

{

/*if(dini_Int(PFile(playerid),"HaveCar")== 1) return SendClientMessage(playerid,ORANGE,"[ERROR]You already have a Car");*/

/*if(dini_Int(PFile(playerid),"HaveCar")== 1) { }

else { SendClientMessage(playerid, ORANGE,"[ERROR]You already have a Car"); return 1; }*/

new HaveCar = (dini_Int(PFile(playerid),"HaveCar"));

if(!IsPlayerInAnyVehicle(playerid)){return 1;}

if(GetCreatorID(vehicleid)!=0)

{

if(HaveCar == 0)

{

if (strmatch(VehicleSystem[GetCreatorID(vehicleid)][owner],Spielername(playerid))){SendClientMessage(playerid,WHITE," Aceasta masina este deja cumparata!");return 1;}

if (strmatch(VehicleSystem[GetCreatorID(vehicleid)][owner],"dealercar"))

{

if(VehicleSystem[GetCreatorID(vehicleid)][preis] < GetPlayerMoney(playerid))

{

strmid(VehicleSystem[GetCreatorID(vehicleid)][owner],Spielername(playerid),0,128,128);

VehicleSystem[GetCreatorID(vehicleid)][owned]=1;

SetVehicleNumberPlate(vehicleid, VehicleSystem[GetCreatorID(vehicleid)][owner]);

GivePlayerMoney(playerid,-VehicleSystem[GetCreatorID(vehicleid)][preis]);

SendClientMessage(playerid,YELLOW," Congratulations with your new purchase!");

SendClientMessage(playerid,WHITE," You can see your personal car commands by using /carhelp");

TogglePlayerControllable(playerid,1);

Delete3DTextLabel(TextUpCar[vehicleid]);

SaveTool();

}

else

{

SendClientMessage(playerid,WHITE,"You don't have enough cash with you!");

}

}

else

{

SendClientMessage(playerid,WHITE,"This car is not for sale!");

}

}

else

{

SendClientMessage(playerid, ORANGE,"[ERROR]You already have a Car");

}

}

else

{

SendClientMessage(playerid,WHITE,"It's not for sale!");

}

if(!dini_Exists(PFile(playerid)))

{

    dini_Create(PFile(playerid));

    dini_IntSet(PFile(playerid),"HaveCar",1);

    dini_IntSet(PFile(playerid),"CarID",vehicleid);

}

else if(dini_Exists(PFile(playerid)))

{

    dini_IntSet(PFile(playerid),"HaveCar",1);

    dini_IntSet(PFile(playerid),"CarID",vehicleid);

}

return 1;

}

if (strcmp(cmd, "/sellveh", true) ==0)

{

if(!IsPlayerInAnyVehicle(playerid)){return 1;}

if(GetCreatorID(vehicleid)!=0)

{

if (IsPlayerAdmin(playerid))

{

tmp = strtok(cmdtext,idx);

if(!strlen(tmp)){SendClientMessage(playerid,WHITE,"INFO: /sellveh [pret]");return 1;}

new Float:vx,Float:vy,Float:vz,Float:va;

GetVehiclePos(GetPlayerVehicleID(playerid),vx,vy,vz);

GetVehicleZAngle(GetPlayerVehicleID(playerid),va);

VehicleSystem[GetCreatorID(vehicleid)][x]=vx;

VehicleSystem[GetCreatorID(vehicleid)][y]=vy;

VehicleSystem[GetCreatorID(vehicleid)][z]=vz;

VehicleSystem[GetCreatorID(vehicleid)][a]=va;

VehicleSystem[GetCreatorID(vehicleid)][preis]=strval(tmp);

VehicleSystem[GetCreatorID(vehicleid)][owned]=0;

VehicleSystem[GetCreatorID(vehicleid)][cLock]=1;

strmid(VehicleSystem[GetCreatorID(vehicleid)][owner],"dealercar",0,128,128);

SendClientMessage(playerid,WHITE,"Aceasta masina e acum de vanzare!");

SaveTool();

Delete3DTextLabel(TextUpCar[vehicleid]);

format(TextCar,sizeof(TextCar),"This car is for sale, price: %d",VehicleSystem[GetCreatorID(vehicleid)][preis]);

TextUpCar[vehicleid] = Create3DTextLabel(TextCar, 0xFFFFFFAA ,0,0,0,20.0,0);

Attach3DTextLabelToVehicle(TextUpCar[vehicleid],vehicleid,0.0,0.0,0.0);

}

else

{

SendClientMessage(playerid,WHITE,"INFO: Nu esti admin ca sa poti vinde masini!");

}

}

return 1;

}[/pawn]

Comanda de /v unlockmycar

[pawn]else if(strcmp(x_nr,"unlockmycar",true) == 0)

{

  new keycar = (dini_Int(PFile(playerid),"HaveCar"));

  new personalcar = (dini_Int(PFile(playerid),"CarID"));

    if(keycar == 1)

    {

      new locked[256];

      locked = strtok(cmdtext, idx);

        if (VehicleSystem[GetCreatorID(vehicleid)][cLock]==0)

        {

      for(new i = 0; i < MAX_PLAYERS; i++)

{

if (IsPlayerConnected(i))

{

SetVehicleParamsForPlayer(personalcar,i,0,0);

}

}

format(string, sizeof(string), "~w~Vehicle~n~~g~Unlocked");

GameTextForPlayer(playerid, string, 4000, 3);

GetPlayerName(playerid, sendername, sizeof(sendername));

format(string,sizeof(string), "* %s has unlocked his personal vehicle, using his car key!", sendername);

ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);

VehicleSystem[GetCreatorID(personalcar)][cLock]=1;

SaveTool();

return 1;

}

}

}[/pawn]

Si da cand o creeze o pot cumpara.

Cel din urma va fi cel dintâi.

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.