Jump to content
  • 0

Problema /vplate


muresan_emanuel2001

Question

Am facut un sistem de masini pe mysql, merg toate comenzile(/vmodel /vcolor /vcreate /vsave /vpark) dar /vplate, imi pune numar de ala default :)) cum e in single player, nu am mai patit asa ceva.

 

if(strcmp(cmd, "/vplate", true) == 0)
    {
    if(PlayerInfo[playerid][pAdmin] < 8) return SendClientMessage(playerid, COLOR_SERVER3, "Nu ai acces la aceasta comanda !");
    new str[512],value;
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_WHITE, "{FFFFCC}Error: You're not in a vehicle.");
    new tmpcar = GetPlayerVehicleID(playerid);
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /vplate [license-plate]");
    return 1;
    }
    value = strval(tmp);
    //StaticVeh[tmpcar][vLicense] = value;
    mysql_format(handle,str,512,"UPDATE `staticveh` SET `License`='%s' WHERE `ID`='%d'",value,tmpcar);
    mysql_tquery(handle,str, "", "");
    DestroyVehicle(tmpcar);
    CreateVehicle(StaticVeh[tmpcar][vModel],StaticVeh[tmpcar][vLocationx],StaticVeh[tmpcar][vLocationy],StaticVeh[tmpcar][vLocationz]+1.0,StaticVeh[tmpcar][vAngle],StaticVeh[tmpcar][vColorOne],StaticVeh[tmpcar][vColorTwo],StaticVeh[tmpcar][vRespawnDelay]);
    SetVehicleNumberPlate(tmpcar,StaticVeh[tmpcar][vLicense]);
    PutPlayerInVehicle(playerid, tmpcar, 0);
    return 1;
}

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0


    SetVehicleNumberPlate(tmpcar,StaticVeh[tmpcar][vLicense]);

trebuie inainte de recrearea masinii, adica asa

 

if(strcmp(cmd, "/vplate", true) == 0)
    {
    if(PlayerInfo[playerid][pAdmin] < 8) return SendClientMessage(playerid, COLOR_SERVER3, "Nu ai acces la aceasta comanda !");
    new str[512],value;
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_WHITE, "{FFFFCC}Error: You're not in a vehicle.");
    new tmpcar = GetPlayerVehicleID(playerid);
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /vplate [license-plate]");
    return 1;
    }
    value = strval(tmp);
    //StaticVeh[tmpcar][vLicense] = value;
    mysql_format(handle,str,512,"UPDATE `staticveh` SET `License`='%s' WHERE `ID`='%d'",value,tmpcar);
    mysql_tquery(handle,str, "", "");
    SetVehicleNumberPlate(tmpcar,StaticVeh[tmpcar][vLicense]);
    DestroyVehicle(tmpcar);
    CreateVehicle(StaticVeh[tmpcar][vModel],StaticVeh[tmpcar][vLocationx],StaticVeh[tmpcar][vLocationy],StaticVeh[tmpcar][vLocationz]+1.0,StaticVeh[tmpcar][vAngle],StaticVeh[tmpcar][vColorOne],StaticVeh[tmpcar][vColorTwo],StaticVeh[tmpcar][vRespawnDelay]);
   
    PutPlayerInVehicle(playerid, tmpcar, 0);
    return 1;
}

Incearca si vezi daca merge.

Edited by Mister

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.