Jump to content
  • 0

Problema setplate


d@rK

Question

Am comanda /v "setplate" care schimba numarul de inmatriculare al masinii.

Problema este ca poti sa pui si numarul **&&Andrei^^45* ........... Eu as vrea sa merga doar dupa acest MODEL : [2numere]-[3cifre]

Exemplu: /v setplate 24-CAP

Va rog daca m-ati putea ajuta nu gasesc nicaieri cum sa fac... Multumesc.

Pawno:

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

        {

if(IsPlayerInVehicle(playerid, vehid) || PlayerInfo[vehid][pPcarkey] != -1 && PlayerInfo[vehid][pPcarkey2] != -1 && PlayerInfo[vehid][pPcarkey3] != -1)

{

        if(cmdtext[idx++] != 32 || cmdtext[idx] == EOS)

                    {

                        SendClientMessage(playerid,0xFFFFFFAA,"FOLOSESTE: /v setplate [numar]");

                        return 1;

    }

    if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)

                {

SendClientMessage(playerid, COLOR_RED, "Nu poti schimba numarul fiind pasager !");

return 1;

                }

                if((vehid >= 1) && (vehid <= 281) && !Ested@rK(playerid))

{

SendClientMessage(playerid, COLOR_RED, "Nu poti schimba numarul masinii acesteia !");

return 1;

                }

    new Float:XX,Float:YY,Float:ZZ,Float:AA;

                    new Float:CarHP, Float:OldCarHP;

                    new panels,doors2,lights2,tires;

                GetVehicleHealth(vehid, CarHP);

                GetVehicleDamageStatus(vehid,panels,doors2,lights2,tires);

        OldCarHP = CarHP;

                format(CarInfo[vehid][cLicense], 32 ,"%s",cmdtext[idx]);

                    SetVehicleNumberPlate(vehid,CarInfo[vehid][cLicense]);

                GetVehiclePos(vehid,XX,YY,ZZ);

                GetVehicleZAngle(vehid, AA);

                SetVehicleToRespawn(vehid);

                SetVehiclePos(vehid,XX,YY,ZZ);

                SetVehicleZAngle(vehid, AA);

                PutPlayerInVehicle(playerid,vehid,0);

                SetVehicleHealth(vehid, OldCarHP);

                UpdateVehicleDamageStatus(vehid,panels,doors2,lights2,tires);

                format(string, sizeof(string), "Ti-ai schimbat Nr. de Inmatriculare la vehicul: {FFFFFF}%s", CarInfo[vehid][cLicense]);

                SendClientMessage(playerid, COLOR_YELLOW, string);

                OnPropUpdate(); SavePlayerData(playerid);

            }

            else

            {

                    SendClientMessage(playerid, 0xFFFFFFAA, "Nu esti in masina ta personala pentru a putea schimba Nr. de Inmatriculare.");

    return 1;

    }

}[/pawn]

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

Buna Ziua, :D

stock ChangeVehPlate( vehicleid )
{
    new string[8], string2[4];
    
    if( vehicleid < 10 ) format(string2,sizeof(string2),"00%i", vehicleid );
    else if( vehicleid < 100 ) format(string2,sizeof(string2),"0%i", vehicleid );
    else format(string2,sizeof(string2),"%i", vehicleid );
    
    format(string,sizeof(string),"LV-%s", string2 );
    
    SetVehicleNumberPlate( vehicleid, string );
    
    return 1;
}

este netestat.

sper ca sti cum sa-l folosesti.

M-am lasat de comunitatea sa-mp.ro

Link to comment
Share on other sites

1. Numarul nu apare pe tablita, eu altceva am cerut :|

2. Nu inteleg scriptu ala Alexica... Si am cu CarInfo[carid][cLicense] , nu cu setnumbetplate..

Nu e bine , va rog ajutor.

Vrea sa poti sa bagi numarul [2numere]-[3litere] , ex: 22-CAR

......

1.Masina trebuie respawnata pentru a se schimba

2.Deci daca o sa pui 2 numere posibil sa se incurce. Incearca asa

stock ChangeVehPlate(vehicleid, cont placuta[] )
{
    new string[32];
    format(string,sizeof(string),"LV-%d-%s", vehicleid, placuta);
    SetVehicleNumberPlate(vehicleid, string );
    
    return 1;
}

Iar ChangeVehPlate(vehicleid, cont placuta[] ) o pui comanda /v setplate.  Sper ca macar asta stii sa faci.

 

1859311972_BANNER-GIREADAcopy-min.thumb.png.48e5e420ae2185dce5b244965a1d2601.png

 

Link to comment
Share on other sites

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.