Jump to content
  • 0

Bug /vipname


andreyctn

Question

Salut.Am o problema la la /vipname am serverul meu propiu< imi fac vehiculul vip si cand ii dau /vipname imi spune Poti folosi aceasta comanda doar pe vehicule VIP.

Poate am gresit cu ceva la Comanda ! Uitati

 

CMD:vipname(playerid, params[])
{
    if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER && GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return SCM(playerid, COLOR_WHITE, "Nu esti intr-un vehicul.");
    new vehicleid = GetPlayerVehicleID(playerid);
    if(IsPlayerConnected(playerid))
    {
        if(PlayerInfo[IsAnOwnableCar(vehicleid)][pUpgrade] == 0)
        {
            new query[256],text[20],test[20];
            if(sscanf(params, "s[20]", text)) return SCM(playerid, COLOR_WHITE, "{FF0000}Usage: {FFFFFF}/vipname [Text]");
            if(strlen(text) > 20) return SendClientMessage(playerid, COLOR_WHITE, "Maximum 20 characters are allowed.");
               if(strlen(text) == 0) return 1;
            SetVipText(playerid, vehicleid);
            mysql_real_escape_string(text, test);
            mysql_format(SQL, query, sizeof(query), "UPDATE `cars` SET `Vip`='%s' WHERE `ID`='%d'", test, CarInfo[IsAnOwnableCar(vehicleid)]);
            mysql_tquery(SQL, query, "", "");
            format(query, sizeof(query), "Text pentru vehicul setat: %s", text);
            SendClientMessage(playerid, COLOR_ADMCOMMANDS, query);
        }
        else return SCM(playerid, COLOR_WHITE, "Poti folosi aceasta comanda doar pe vehicule VIP.");
    }
    return 1;
}

Edited by andreyctn
Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0

if(PlayerInfo[IsAnOwnableCar(vehicleid)][pUpgrade] == 0)

Asta arata ca doar daca nu ai VIP adica daca ai '0' poti da /vipname

Modifica if(PlayerInfo[IsAnOwnableCar(vehicleid)][pUpgrade] == 0) cu if(PlayerInfo[IsAnOwnableCar(vehicleid)][pUpgrade] == 1) si iti va merge sigur

Link to comment
Share on other sites

  • 0
La 19.02.2018 la 22:01, andreyctn a spus:

Nu merge.

poate trebuie sa bag ceva aici ?

 

mysql_tquery(SQL, query, "? ", "?");

Nu are legatura cu query-ul. Totul tine de verificarea  if(PlayerInfo[IsAnOwnableCar(vehicleid)][pUpgrade] == 0). care ar trebui sa fie asa  if(PlayerInfo[IsAnOwnableCar(vehicleid)][pUpgrade] == 1). Daca nu merge fa un debug cand faci masina vip si unul cand folosesti comanda vipname. (debugul il faci afisand un mesaj pt jucator cu valoarea variabilei pUpgrade)

Link to comment
Share on other sites

  • 0

Incerca asa

CMD:vipname(playerid, params[])
{
    if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER && GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return SCM(playerid, COLOR_WHITE, "Nu esti intr-un vehicul.");
    new vehicleid = GetPlayerVehicleID(playerid);

    if(!IsPlayerConnected(playerid)) return SCM(playerid, COLOR_WHITE, "Nu esti conectat");
    if(PlayerInfo[IsAnOwnableCar(vehicleid)][pUpgrade] == 0) return SCM(playerid, COLOR_WHITE, "Poti folosi aceasta comanda doar pe vehicule VIP.");

    new query[256],text[20],test[20];
    if(sscanf(params, "s[20]", text)) return SCM(playerid, COLOR_WHITE, "{FF0000}Usage: {FFFFFF}/vipname [Text]");
    if(strlen(text) < 1 || text(title) > 20) return SCM(playerid, COLOR_GREY, "Minim 1 caracte maxim 20");
    
    SetVipText(playerid, vehicleid);
    mysql_real_escape_string(text, test);
    mysql_format(SQL, query, sizeof(query), "UPDATE `cars` SET `Vip`='%s' WHERE `ID`='%d'", test, CarInfo[IsAnOwnableCar(vehicleid)]);
    mysql_tquery(SQL, query, "", "");
    format(query, sizeof(query), "Text pentru vehicul setat: %s", text);
    SendClientMessage(playerid, COLOR_ADMCOMMANDS, query);
    return 1;
}

 

Link to comment
Share on other sites

  • 0
La 22/2/2018 la 14:48, MiritaXD a spus:

Incerca asa


CMD:vipname(playerid, params[])
{
    if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER && GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return SCM(playerid, COLOR_WHITE, "Nu esti intr-un vehicul.");
    new vehicleid = GetPlayerVehicleID(playerid);

    if(!IsPlayerConnected(playerid)) return SCM(playerid, COLOR_WHITE, "Nu esti conectat");
    if(PlayerInfo[IsAnOwnableCar(vehicleid)][pUpgrade] == 0) return SCM(playerid, COLOR_WHITE, "Poti folosi aceasta comanda doar pe vehicule VIP.");

    new query[256],text[20],test[20];
    if(sscanf(params, "s[20]", text)) return SCM(playerid, COLOR_WHITE, "{FF0000}Usage: {FFFFFF}/vipname [Text]");
    if(strlen(text) < 1 || text(title) > 20) return SCM(playerid, COLOR_GREY, "Minim 1 caracte maxim 20");
    
    SetVipText(playerid, vehicleid);
    mysql_real_escape_string(text, test);
    mysql_format(SQL, query, sizeof(query), "UPDATE `cars` SET `Vip`='%s' WHERE `ID`='%d'", test, CarInfo[IsAnOwnableCar(vehicleid)]);
    mysql_tquery(SQL, query, "", "");
    format(query, sizeof(query), "Text pentru vehicul setat: %s", text);
    SendClientMessage(playerid, COLOR_ADMCOMMANDS, query);
    return 1;
}

 

C:\Users\Utente\Desktop\Gamemode AngelZone\gamemodes\VLM.pwn(40240) : error 012: invalid function call, not a valid address
C:\Users\Utente\Desktop\Gamemode AngelZone\gamemodes\VLM.pwn(40240) : error 017: undefined symbol "title"
C:\Users\Utente\Desktop\Gamemode AngelZone\gamemodes\VLM.pwn(40240) : error 029: invalid expression, assumed zero
C:\Users\Utente\Desktop\Gamemode AngelZone\gamemodes\VLM.pwn(40240) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664              Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.


Pfff numai probleme sami bag ceva fratilor.

 

Link to comment
Share on other sites

  • 0
@andreyctn
CMD:vipname(playerid, params[])
{
    if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER && GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return SCM(playerid, COLOR_WHITE, "Nu esti intr-un vehicul.");
    new vehicleid = GetPlayerVehicleID(playerid);

    if(!IsPlayerConnected(playerid)) return SCM(playerid, COLOR_WHITE, "Nu esti conectat");
    if(PlayerInfo[IsAnOwnableCar(vehicleid)][pUpgrade] == 0) return SCM(playerid, COLOR_WHITE, "Poti folosi aceasta comanda doar pe vehicule VIP.");

    new query[256],text[20],test[20];
    if(sscanf(params, "s[20]", text)) return SCM(playerid, COLOR_WHITE, "{FF0000}Usage: {FFFFFF}/vipname [Text]");
    if(strlen(text) < 1 || text(text) > 20) return SCM(playerid, COLOR_GREY, "Minim 1 caracte maxim 20");
    
    SetVipText(playerid, vehicleid);
    mysql_real_escape_string(text, test);
    mysql_format(SQL, query, sizeof(query), "UPDATE `cars` SET `Vip`='%s' WHERE `ID`='%d'", test, CarInfo[IsAnOwnableCar(vehicleid)]);
    mysql_tquery(SQL, query, "", "");
    format(query, sizeof(query), "Text pentru vehicul setat: %s", text);
    SendClientMessage(playerid, COLOR_ADMCOMMANDS, query);
    return 1;
}
Link to comment
Share on other sites

  • 0

de ce folosesti asta 

if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER && GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return SCM(playerid, COLOR_WHITE, "Nu esti intr-un vehicul.");

 

cand este exact acelasi lucru cu asta 

if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SCM(playerid, ........ )
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.