Jump to content
  • 0

Problema masini personale!


Flavius88

Question

Buna, am o problema la sistemul de masini personale, cred ca problema este destul de cunoscuta.

Creez o masina si ii dau numele proprietarului dar daca le sterg ele tot raman inregistrate pe acel player.Folosesc /dtc sau /adeletecar si la fel se intampla la ambele, zice ca playerul acesta deja detine 2 masini personale(limita).

Acestea sunt codurile pawno:

/acreatecar

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

{

    if(PlayerInfo[playerid][pAdmin] == 1339)

    {

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /acreatecar [carid] [culoare1] [culoare2]");

return 1;

}

new car;

car = strval(tmp);

if(car < 400 || car > 611) { SendClientMessage(playerid, COLOR_WHITE, " Vehicle Number can't be below 400 or above 611 !"); return 1; }

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /acreatecar [carid] [culoare1] [culoare2]");

return 1;

}

new color1;

color1 = strval(tmp);

if(color1 < 0 || color1 > 252) { SendClientMessage(playerid, COLOR_WHITE, " Color Number can't be below 0 or above 252 !"); return 1; }

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /acreatecar [carid] [culoare1] [culoare2]");

return 1;

}

new color2;

color2 = strval(tmp);

if(color2 < 0 || color2 > 252) { SendClientMessage(playerid, COLOR_WHITE, " Color Number can't be below 0 or above 252 !"); return 1; }

new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid, X,Y,Z);

            new thiscar = CreateVehicle(car,X,Y,Z,1,color1,color2,99999999);

CarInfo[thiscar][cOwned] = 0; CarInfo[thiscar][cModel] = car; CarInfo[thiscar][cColorOne] = color1; CarInfo[thiscar][cColorTwo] = color2;

CarInfo[thiscar][cLocationx] = X; CarInfo[thiscar][cLocationy] = Y; CarInfo[thiscar][cLocationz] = Z; CarInfo[thiscar][cAngle] = 1;

PutPlayerInVehicle(playerid,thiscar,0);

strmid(CarInfo[vehid][cOwner], "No-one", 0, strlen("No-one"), 999);

format(CarInfo[thiscar][cDescription], 32, "%s",vehName[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);

format(string, sizeof(string), "The car %s [%d] has been created",CarInfo[thiscar][cDescription],thiscar);

SendClientMessage(playerid, COLOR_BLUE, string);

ShowPlayerDialog(playerid,DIALOGIDSETOWNER,DIALOG_STYLE_INPUT,"{E0941B}Vehicle owner","Write playerid/PartOfName \nto make owner this car:","Enter","Close");

}

else

{

    SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command!");

return 1;

}

}

if(strcmp(cmd, "/dveh", true) == 0 || strcmp(cmd, "/dvehicle", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

        if(PlayerInfo[playerid][pPcarkey] != -1)

        {

            ShowPlayerDialog(playerid,DIALOGDVEH,DIALOG_STYLE_LIST,"  Donater vehicle", "Change vehicle model \nChange vehicle colors \nSave the position vehicle \nRespawn the vehicle","Enter","Close");

            return 1;

        }

        else SendClientMessage(playerid, COLOR_GREY, " Numai donatorii pot folosi aceasta comanda (/donatie).");

    }

}[/pawn]

/dtc

[pawn]    if(strcmp(cmd, "/destroythiscar", true) == 0 || strcmp(cmd, "/dtc", true) == 0) // by DBZ

{

    if(IsPlayerConnected(playerid))

    {

        if(PlayerInfo[playerid][pAdmin] < 1339 )

{

    SendClientMessage(playerid, COLOR_GRAD1, "  you are not authorized to use that command!");

    return 1;

}

if(IsPlayerInAnyVehicle(playerid))

{

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

    format(string, 256, "AdmWarning: Admin %s has just destroyed vehicle id %d.",sendername,GetPlayerVehicleID(playerid));

ABroadCast(COLOR_YELLOW,string,1);

DestroyVehicle(GetPlayerVehicleID(playerid));

  RemovePlayerFromVehicle(playerid);

    SendClientMessage(playerid, COLOR_GREY, "  Vehicle Destroyed !");

  }

}

return 1;

}[/pawn]

/adeletecar

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

{

    if(PlayerInfo[playerid][pAdmin] == 1339)

  {

            CarInfo[idcar][cOwned] = 0; CarInfo[idcar][cModel] = 0; CarInfo[idcar][cColorOne] = 0; CarInfo[idcar][cColorTwo] = 0;

CarInfo[idcar][cLocationx] = 0; CarInfo[idcar][cLocationy] = 0; CarInfo[idcar][cLocationz] = 0; CarInfo[idcar][cAngle] = 0;

strmid(CarInfo[idcar][cOwner], "No-one", 0, strlen("No-one"), 999);

format(CarInfo[idcar][cDescription], 32, "0");

DestroyVehicle(idcar);

OnCarUpdate(); SavePlayerData(playerid);

    }

}

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

{

    if(PlayerInfo[playerid][pAdmin] == 1339)

    {

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /acreatecar [carid] [culoare1] [culoare2]");

return 1;

}

new car;

car = strval(tmp);

if(car < 400 || car > 611) { SendClientMessage(playerid, COLOR_WHITE, " Vehicle Number can't be below 400 or above 611 !"); return 1; }

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /acreatecar [carid] [culoare1] [culoare2]");

return 1;

}

new color1;

color1 = strval(tmp);

if(color1 < 0 || color1 > 252) { SendClientMessage(playerid, COLOR_WHITE, " Color Number can't be below 0 or above 252 !"); return 1; }

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /acreatecar [carid] [culoare1] [culoare2]");

return 1;

}

new color2;

color2 = strval(tmp);

if(color2 < 0 || color2 > 252) { SendClientMessage(playerid, COLOR_WHITE, " Color Number can't be below 0 or above 252 !"); return 1; }

new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid, X,Y,Z);

            new thiscar = CreateVehicle(car,X,Y,Z,1,color1,color2,99999999);

CarInfo[thiscar][cOwned] = 0; CarInfo[thiscar][cModel] = car; CarInfo[thiscar][cColorOne] = color1; CarInfo[thiscar][cColorTwo] = color2;

CarInfo[thiscar][cLocationx] = X; CarInfo[thiscar][cLocationy] = Y; CarInfo[thiscar][cLocationz] = Z; CarInfo[thiscar][cAngle] = 1;

PutPlayerInVehicle(playerid,thiscar,0);

strmid(CarInfo[vehid][cOwner], "No-one", 0, strlen("No-one"), 999);

format(CarInfo[thiscar][cDescription], 32, "%s",vehName[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);

format(string, sizeof(string), "The car %s [%d] has been created",CarInfo[thiscar][cDescription],thiscar);

SendClientMessage(playerid, COLOR_BLUE, string);

ShowPlayerDialog(playerid,DIALOGIDSETOWNER,DIALOG_STYLE_INPUT,"{E0941B}Vehicle owner","Write playerid/PartOfName \nto make owner this car:","Enter","Close");

}

else

{

    SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command!");

return 1;

}

}

if(strcmp(cmd, "/dveh", true) == 0 || strcmp(cmd, "/dvehicle", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

        if(PlayerInfo[playerid][pPcarkey] != -1)

        {

            ShowPlayerDialog(playerid,DIALOGDVEH,DIALOG_STYLE_LIST,"  Donater vehicle", "Change vehicle model \nChange vehicle colors \nSave the position vehicle \nRespawn the vehicle","Enter","Close");

            return 1;

        }

        else SendClientMessage(playerid, COLOR_GREY, " Numai donatorii pot folosi aceasta comanda (/donatie).");

    }

}[/pawn]

Va rog ajutatima :D Multumesc!

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.