Jump to content
  • 0

Imbunatatire system Dealership


PauLL

Question

Salutare baieti,astazi vreau sa-mi imbunatatesc systemul de dealership,sistemul actual este dynamic,insa masina trebuie creata de catre admin cu /acreatecar iar cine o vrea intra in ea si o cumpara[stilul vechi],eu vreau sa fie tot dynamic,adica tot systemul asta.Nu vreau sa-l sterg/inlocuiesc,ci vreau sa-l modific pe acesta.

Ce vreau sa fac?Sa fac un system in care jucatorul se duce la dealer si scrie de exemplu /buycar infernus,si sa-i creeze o masina infernus,sa-i ia banii si masina sa fie trecuta pe numele lui.[Gen ca pe bugged,etc]

Sper ca ati inteles,nu va cer scriptul gata facut,va cer doar sfaturi in cum as putea sa fac asta.

Eu m-am gandit deja la o idee,sa combin comenzile /buycar si /acreatecar intr-una singura ca atunci cand playerul scrie /buycar infernus,sa i-o creeze si sa ii si treaca numele la proprietari+ sa-i scada banii..

 

/acreatecar :

Comanda /acreatecar:     //===============================[/acreatecar]================================== 
if(strcmp(cmd"/acreatecar"true) == 0
    { 
        if(
PlayerInfo[playerid][pAdmin] >= 1339 || IsPlayerAdmin(playerid)) 
         { 
            
tmp strtok(cmdtextidx); 
            if(!
strlen(tmp)) 
            { 
                
SendClientMessage(playeridCOLOR_WHITE"{00A1FF}USAGE:{C0C0C0} /acreatecar [carid] [color1] [color2] [price]"); 
                return 
1
            } 
            new 
car
            
car strval(tmp); 
            if(
car 400 || car 611) { SendClientMessage(playeridCOLOR_WHITE"{0950F7}* Vehicle Number can't be below 400 or above 611 !"); return 1; } 
            
tmp strtok(cmdtextidx); 
            if(!
strlen(tmp)) { SendClientMessage(playeridCOLOR_WHITE"{00A1FF}USAGE:{C0C0C0} /acreatecar [carid] [color1] [color2] [price]"); return 1; } 
            new 
color1
            
color1 strval(tmp); 
            if(
color1 || color1 126) { SendClientMessage(playeridCOLOR_WHITE"{0950F7}* Color Number can't be below 0 or above 126 !"); return 1; } 
            
tmp strtok(cmdtextidx); 
            if(!
strlen(tmp)) { SendClientMessage(playeridCOLOR_WHITE"{00A1FF}USAGE:{C0C0C0} /acreatecar [carid] [color1] [color2] [price]"); return 1; } 
            new 
color2
            
color2 strval(tmp); 
            if(
color2 || color2 126) { SendClientMessage(playeridCOLOR_WHITE"{0950F7}* Color Number can't be below 0 or above 126 !"); return 1; } 
            
tmp strtok(cmdtextidx); 
            if(!
strlen(tmp)) { SendClientMessage(playeridCOLOR_WHITE"{00A1FF}USAGE:{C0C0C0} /acreatecar [carid] [color1] [color2] [price]"); return 1; } 
            new 
Float:X,Float:Y,Float:ZGetPlayerPos(playeridX,Y,Z); 
            new 
thiscar CreateVehicle(car,X,Y,Z,1,color1,color2,99999999); 
            new 
value strval(tmp); 
              
CarInfo[thiscar][cOwned] = 0CarInfo[thiscar][cModel] = carCarInfo[thiscar][cColorOne] = color1CarInfo[thiscar][cColorTwo] = color2
            
CarInfo[thiscar][cLocationx] = XCarInfo[thiscar][cLocationy] = YCarInfo[thiscar][cLocationz] = ZCarInfo[thiscar][cAngle] = 1
              
CarInfo[thiscar][cValue] = valueCarInfo[thiscar][paintjob] = -1LoadComponents(thiscar); PutPlayerInVehicle(playerid,thiscar,0); 
            
strmid(CarInfo[vehid][cOwner], "Dealership"0strlen("Dealership"), 999); 
            
format(CarInfo[thiscar][cDescription], 32"%s",vehName[GetVehicleModel(GetPlayerVehicleID(playerid))-400]); 
//            format(TextCar, sizeof(TextCar), "{EE1111}ForSale: {80D52B}• $%d •", CarInfo[thiscar][cValue]); 
//            TextUpCar[thiscar] = Create3DTextLabel(TextCar, 0x33AAFFFF , 0.0, 0.0, 0.0, 25, 0, 1); 
//            Attach3DTextLabelToVehicle(TextUpCar[thiscar], thiscar, 0.0, 0.0, 0.1); 
            
format(stringsizeof(string), " Personal Car was created.ID: {FFFFFF}[%d]"thiscar); 
            
SendClientMessage(playeridCOLOR_GREENstring); 
            
//ShowPlayerDialog(playerid,DIALOGIDSETOWNER,DIALOG_STYLE_INPUT,"{E0941B}Vehicle owner","Scrie ID/Nume player\nca sa il faci proprietar:","Enter","Close"); 
            
OnCarUpdate(); 
            return 
1
        } 
        else 
        { 
            
SendClientMessage(playeridCOLOR_RED" You are not authorized to use that command "); 
            return 
1
        } 
    } 

 

Si comanda /buycar

 else if(strcmp(x_nr,"buy",true) == 0
            { 
                if(
IsAnOwnableCar(idcar)) 
                { 
                    if(
PlayerInfo[playerid][pPcarkey] == -1) { } 
                    else if(
PlayerInfo[playerid][pPcarkey2] == -1) { } 
                    else if(
PlayerInfo[playerid][pPcarkey3] == -1) { } 
                    else { 
SendClientMessage(playeridCOLOR_GREY"* Detii 3 masini!"); return 1; } 
                    if(
CarInfo[idcar][cOwned]==1
                    { 
                        
SendClientMessage(playeridCOLOR_GREY"Someone already owns this car."); 
                        return 
1
                    } 
                    if(
GetPlayerMoney(playerid) >= CarInfo[idcar][cValue]) 
                    { 
                        if(
PlayerInfo[playerid][pPcarkey] == -1) { PlayerInfo[playerid][pPcarkey] = idcar; } 
                        else if(
PlayerInfo[playerid][pPcarkey2] == -1) { PlayerInfo[playerid][pPcarkey2] = idcar; } 
                        else if(
PlayerInfo[playerid][pPcarkey3] == -1) { PlayerInfo[playerid][pPcarkey3] = idcar; } 
                        else { return 
1; } 
                        
CarInfo[idcar][cOwned] = 1
                        
GetPlayerName(playeridsendernamesizeof(sendername)); 
                        
strmid(CarInfo[idcar][cOwner], sendername0strlen(sendername), 999); 
                        
GivePlayerMoney(playerid,-CarInfo[idcar][cValue]); 
                        
Delete3DTextLabel(TextUpCar[idcar]); 
                        
//format(TextCar, sizeof(TextCar), "{EE1111}Owner: {0099FF}• %s •", CarInfo[idcar][cOwner]); 
                        //TextUpCar[idcar] = Create3DTextLabel(TextCar, 0x33AAFFFF, 0.0, 0.0, 0.0, 25, 0, 1); 
                        //Attach3DTextLabelToVehicle(TextUpCar[idcar], idcar, 0.0, 0.0, 0.1); 
                        
OnCarUpdate(); SavePlayerData(playerid); 
                        
PlayerPlaySound(playerid10520.00.00.0); 
                        
GameTextForPlayer(playerid"~w~Felicitari~n~Nu uita sa o parchezi cu /v park !"50003); 
                        
TogglePlayerControllable(playerid1); 
                        return 
1
                    }  

 

 

Astept orice fel de sfaturi cum as putea sa fac asta,multumesc anticipat.

Edited by PauLL
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.