Jump to content
  • 0

bug masini personale


Question

Posted

Folosesc sistemu de masini personale /av insa dupa ce creez masina personala daca dau rr la server raman salvate pe server insa total aiurea adica masina lu "X" devine masina lu "Y"....

RPG.VIBEPLAY.RO

Recomand acest server Romanesc bY woozie aka. weedluver aka. undertaker !!

3 answers to this question

Recommended Posts

Posted

Da-ne sistemul sa il vedem si fi mai explicit nu prea am inteles.

[pawn]if(strcmp(cmd, "/av", true) == 0 || strcmp(cmd, "/avehicle", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

        if(gPlayerLogged[playerid] == 0)

        {

            SendClientMessage(playerid, COLOR_GREY, "  You need to login first ! ");

            return 1;

        }

        new x_nr[64];

        x_nr = strtok(cmdtext, idx);

        if(!strlen(x_nr))

        {

            SendClientMessage(playerid, COLOR_WHITE, "HINT: (/av)ehicle [name]");

            SendClientMessage(playerid, COLOR_WHITE, "Available names: destroy, create, edit, info");

            return 1;

        }

if(PlayerInfo[playerid][pAdmin] >= 1338)

{

if(strcmp(x_nr, "destroy", true) == 0)

{

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: destroy [car id]");

return 1;

}

new car;

new text[20];

car = strval(tmp);

if(CarInfo[car][cOwned] == 0)

{

SendClientMessage(playerid, COLOR_GRAD2, "This is not an ownable car!");

return 1;

}

CarInfo[car][cOwned] = 0;

text = "No-One";

strmid(CarInfo[car][cOwner], text, 0, strlen(text), 999);

SendClientMessage(playerid, COLOR_WHITE, "* You sold this car!");

DestroyVehicle(car);

SaveCar(car);

}

else if(strcmp(x_nr,"create",true) == 0)

{

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: create [carmodel] [color1] [color2]");

return 1;

}

new model;

model = strval(tmp);

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: create [carmodel] [color1] [color2]");

return 1;

}

new color1;

color1 = strval(tmp);

if(color1 < 0 && color1 > 126)

{

SendClientMessage(playerid, COLOR_GREY, "  Wrong color id!");

return 1;

}

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: create [carmodel] [color1] [color2]");

return 1;

}

new color2;

color2 = strval(tmp);

if(color2 < 0 && color2 > 126)

{

SendClientMessage(playerid, COLOR_GREY, "  Wrong color id!");

return 1;

}

new car = 0;

for(new h = 760; h < sizeof(CarInfo); h++)

{

if(CarInfo[h][cOwned] == 0)

{

car = h;

h = 1500;

}

}

format(string, 128, "cars/%d.ini", car);

new Float:AX,Float:AY,Float:AZ,Float:Angle;

GetPlayerPos(playerid, AX,AY,AZ);

GetPlayerFacingAngle(playerid, Angle);

if(dini_Exists(string))

{

CarInfo[car][cID] = car;

CarInfo[car][cOwned] = 1;

new text[20];

text = "No-One";

strmid(CarInfo[car][cOwner], text, 0, strlen(text), 999);

CarInfo[car][cLocationx] = AX;

CarInfo[car][cLocationy] = AY;

CarInfo[car][cLocationz] = AZ;

CarInfo[car][cAngle] = Angle;

CarInfo[car][cModel] = model;

CarInfo[car][cColorOne] = color1;

CarInfo[car][cColorTwo] = color2;

SaveCar(car);

}

else

{

dini_Create(string);

CarInfo[car][cID] = car;

CarInfo[car][cOwned] = 1;

new text[20];

text = "No-One";

strmid(CarInfo[car][cOwner], text, 0, strlen(text), 999);

CarInfo[car][cLocationx] = AX;

CarInfo[car][cLocationy] = AY;

CarInfo[car][cLocationz] = AZ;

CarInfo[car][cAngle] = Angle;

CarInfo[car][cModel] = model;

CarInfo[car][cColorOne] = color1;

CarInfo[car][cColorTwo] = color2;

SaveCar(car);

}

ownedcar[car] = CreateVehicle(CarInfo[car][cModel],CarInfo[car][cLocationx],CarInfo[car][cLocationy],CarInfo[car][cLocationz],CarInfo[car][cAngle],CarInfo[car][cColorOne],CarInfo[car][cColorTwo],300);

SendClientMessage(playerid, COLOR_GRAD2, "Type /avehicle to view the vehicle manual!");

}

else if(strcmp(x_nr,"edit",true) == 0)

{

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD1, "{00A1FF}USAGE{FFFFFF}: /edit [statcode] [amount]");

SendClientMessage(playerid, COLOR_GRAD4, "|1 ID |2 Model |3 Owner |4 Owned ");

return 1;

}

new stat;

stat = strval(tmp);

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD1, "{00A1FF}USAGE{FFFFFF}: /edit [statcode] [amount]");

SendClientMessage(playerid, COLOR_GRAD4, "|1 ID |2 Model |3 Owner |4 Owned ");

return 1;

}

new amount;

amount = strval(tmp);

if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)

{

new vehid = GetPlayerVehicleID(playerid);

if(IsAnPersonalCar(vehid))

{

switch (stat)

{

case 1:

{

CarInfo[vehid][cID] = amount;

format(string, sizeof(string), "  The Car ID Was Set To %d", amount);

SendClientMessage(playerid, COLOR_GREY, string);

}

case 2:

{

CarInfo[vehid][cModel] = amount;

format(string, sizeof(string), "  The Car Model Was Set To %d", amount);

SendClientMessage(playerid, COLOR_GREY, string);

}

case 3:

{

GetPlayerName(amount, sendername, sizeof(sendername));

strmid(CarInfo[vehid][cOwner], sendername, 0, strlen(sendername), 999);

format(string, sizeof(string), "  The Car Owner Was Set To %s", sendername);

SendClientMessage(playerid, COLOR_GREY, string);

}

case 4:

{

CarInfo[vehid][cOwned] = amount;

format(string, sizeof(string), "  The Car Owned Was Set To %d", amount);

SendClientMessage(playerid, COLOR_GREY, string);

}

}

SaveCar(vehid);

}

else

{

SendClientMessage(playerid, COLOR_GREY, "This car isn't an personal car");

return 1;

}

}

else

{

SendClientMessage(playerid, COLOR_GREY, "You must be in an personal car");

return 1;

}

}

else if(strcmp(x_nr,"info",true) == 0)

{

if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)

{

new vehid = GetPlayerVehicleID(playerid);

format(string, sizeof(string), "Owned: %d | Owner: %s | CarColor1: %d | CarColor2: %d | CarID: %d", CarInfo[vehid][cOwned], CarInfo[vehid][cOwner], CarInfo[vehid][cColorOne], CarInfo[vehid][cColorTwo], CarInfo[vehid][cID]);

SendClientMessage(playerid, COLOR_WHITE, string);

}

}

else

{

SendClientMessage(playerid, COLOR_WHITE, "HINT: (/av)ehicle [name]");

SendClientMessage(playerid, COLOR_WHITE, "Available names: destroy, create, edit, info");

return 1;

}

}

else

{

SendClientMessage(playerid, COLOR_GREY, "You must be an admin to use this command");

return 1;

}

}

}[/pawn]

RPG.VIBEPLAY.RO

Recomand acest server Romanesc bY woozie aka. weedluver aka. undertaker !!

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.