Jump to content
  • 0

Problema vip


OldeR

Question

Salut , am o problema la /vipname  imi zice ca acest vehicul nu este unul vip , l-am upgradat si imi spune poti folosi aceasta comanda doar pe vehiculele vip  si este vip masina... help

 

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;

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Pune asta daca te ajuta :

Citat

CMD:vipname(playerid, params[])
{
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to log in first.");
    if(!IsPlayerInAnyVehicle(playerid)) return SCM(playerid, COLOR_LIGHTGREEN3, "Nu esti intr-un vehicul!");
    new carid = GetPlayerVehicleID(playerid),idcar=-1;
    for(new vv; vv < MAX_PERSONAL_VEHICLES; vv++) {
        if(carid == PlayerInfo[playerid][pCarID][vv]) {
            idcar = vv; }
    }
    if(idcar == -1) return SCM(playerid, COLOR_LIGHTGREEN3, "Poti folosi aceasta comanda doar pe vehicule VIP.");
    if(IsPlayerConnected(playerid)) {
        if(carid == PlayerInfo[playerid][pCarID][idcar]) {
            if(PlayerInfo[playerid][pCarVIP][idcar] > 0) {
                new query[256],text[20],test[20];
                if(sscanf(params, "s[20]", text)) return SCM(playerid, COLOR_GREY, "{dd0808}Syntax:{FFFFFF} /vipname [text]");
                if(strlen(text) > 20) return SendClientMessage(playerid, COLOR_LIGHTGREEN3, "Maximum 20 characters are allowed.");
                if(strlen(text) == 0) return 1;
                format(CarVipName[playerid][idcar], 20, text);
                SetVipText(playerid, idcar);
                mysql_real_escape_string(text, test);
                mysql_format(SQL, query, sizeof(query), "UPDATE `cars` SET `VipText`='%s' WHERE `ID`='%d'", test, PlayerInfo[playerid][pCar][idcar]);
                mysql_tquery(SQL, query, "", "");
                format(query, sizeof(query), "Text pentru vehicul setat: %s", text);
                SendClientMessage(playerid, COLOR_ADMCOMMANDS, query); }
            else return SCM(playerid, COLOR_LIGHTGREEN3, "Poti folosi aceasta comanda doar pe vehicule VIP."); }
        else return SCM(playerid, COLOR_LIGHTGREEN3, "Poti folosi aceasta comanda doar pe vehicule VIP."); }
    return 1;
}

 

Edited by LucaAdv.

GameMode Edited: gamemode

Servicii Scripting:

Contact:
Email: [email protected]
Discord: LucaAdv //  LHS#9084

 

Link to comment
Share on other sites

  • 0
Acum 1 oră, LucaAdv. a spus:

Pune asta daca te ajuta :

 

C:\Users\Ionut\Desktop\GM PRINCIPAL\gamemodes\VLM.pwn(41716) : error 017: undefined symbol "MAX_PERSONAL_VEHICLES"
C:\Users\Ionut\Desktop\GM PRINCIPAL\gamemodes\VLM.pwn(41723) : error 017: undefined symbol "pCarVIP"
C:\Users\Ionut\Desktop\GM PRINCIPAL\gamemodes\VLM.pwn(41723) : error 029: invalid expression, assumed zero
C:\Users\Ionut\Desktop\GM PRINCIPAL\gamemodes\VLM.pwn(41723) : warning 215: expression has no effect
C:\Users\Ionut\Desktop\GM PRINCIPAL\gamemodes\VLM.pwn(41723) : error 001: expected token: ";", but found "]"
C:\Users\Ionut\Desktop\GM PRINCIPAL\gamemodes\VLM.pwn(41723) : fatal error 107: too many error messages on one line

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


5 Errors.
 

Link to comment
Share on other sites

  • 0
Acum 2 ore, LucaAdv. a spus:

Pune asta daca te ajuta :

e clar ca daca ii dai alt cod si nu il adapteaza nu o sa ii mearga

Acum 12 ore, OldeR a spus:

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

pUpgrade ce anume reprezinta?

 

Desi nu cred ca pUpgrade are treaba cu o verificare pentru a vedea daca vehiculul este vip, trebuie sa faci si o verificare sa vezi daca vehiculul in care e playerul este vip.

Edited by custura
Link to comment
Share on other sites

  • 0

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)
            {
                if(PlayerInfo[playerid][AICI PUNE TU CUM AI DEFINIT VEHICULUL VIP][vehicleid] > 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.");
            }
            else return SCM(playerid, COLOR_WHITE, "Poti folosi aceasta comanda doar pe vehicule detinute de tine.");
        }
    return 1;

Link to comment
Share on other sites

  • 0
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 true;
    
    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 || strlen(text) > 20) return SendClientMessage(playerid, COLOR_WHITE, "Maximum 20 characters are allowed.");
    
    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;
} 
Edited by MiritaXD
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.