Jump to content
  • 0

Dynamic DS


PauLL

Question

Salutare,sunt in drumul spre a construi un dealership dynamic,cu dialog-uri ,cu de toate,etc[acel tip de ds la care playerul merge undeva,scrie /buy si ii apare maniul cu masini,da click pe infernus si o cumpara].

 

Momentan sunt in lucrari cu aceasta comanda,sunt la o comanda de test[ /buyinfernus].

 

Nu stiu ce am facut gresit la aceasta comanda,am vrut ca cel care scrie /buyinfernus,sa i se creeze o masina la care el sa fie OWNER,sper ca intelegeti.

Masina se creeaza,banii scad,insa nu este pe numele celui care da /buyinfernus.

 

Comanda:  

  // comanda buy infernus//
        if(strcmp(cmd, "/buyinfernus", true) == 0)
    {
        if(PlayerInfo[playerid][pLevel] >= 5 )
         {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_WHITE, "{00A1FF}USAGE:{C0C0C0} /buyinfernus [color1] [color2] ");
                return 1;
            }
        //    new car;
        //    car = strval(tmp);
        //    if(car < 411 || car > 411) { SendClientMessage(playerid, COLOR_WHITE, "{0950F7}*Aceasta este comanda de a cumpara infernus !"); return 1; }
        //    tmp = strtok(cmdtext, idx);
        //    if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "{00A1FF}USAGE:{C0C0C0} /buyinfernus"); return 1; }
            new color1;
            color1 = strval(tmp);
            if(color1 < 0 || color1 > 126) { SendClientMessage(playerid, COLOR_WHITE, "{0950F7}* Color Number can't be below 0 or above 126 !"); return 1; }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "{00A1FF}USAGE:{C0C0C0} /acreatecar [carid] [color1] [color2] [price]"); return 1; }
            new color2;
            color2 = strval(tmp);
            if(color2 < 0 || color2 > 126) { SendClientMessage(playerid, COLOR_WHITE, "{0950F7}* Color Number can't be below 0 or above 126 !"); return 1; }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "{00A1FF}USAGE:{C0C0C0} /acreatecar [carid] [color1] [color2] [price]"); return 1; }
            new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid, X,Y,Z);
            new thiscar = CreateVehicle(411,X,Y,Z,1,color1,color2,99999999);
          //  new value = strval(tmp);

            CarInfo[thiscar][cModel] = 411; CarInfo[thiscar][cColorOne] = color1; CarInfo[thiscar][cColorTwo] = color2;
               CarInfo[thiscar][cLocationx] = X; CarInfo[thiscar][cLocationy] = Y; CarInfo[thiscar][cLocationz] = Z; CarInfo[thiscar][cAngle] = 1;
            CarInfo[thiscar][paintjob] = -1; LoadComponents(thiscar); PutPlayerInVehicle(playerid,thiscar,0);


            CarInfo[thiscar][cOwned] = 1;
            GetPlayerName(playerid, sendername, sizeof(sendername));
            strmid(CarInfo[thiscar][cOwner], sendername, 0, strlen(sendername), 999);
            GivePlayerMoney(playerid,-150000);
            //Delete3DTextLabel(TextUpCar[idcar]);
              OnCarUpdate(); SavePlayerData(playerid);
            PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
            GameTextForPlayer(playerid, "~w~Felicitari~n~ai platit 150k pentru infernus !", 5000, 3);
            TogglePlayerControllable(playerid, 1);

          return 1;
          }
    }

Astept orice tip de sfat.

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

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.