SA-MP Forums

Go Back   SA-MP Forums > Non-English > Languages > Romānă/Romanian

 
 
Thread Tools Display Modes
Old 18/04/2014, 01:59 PM   #1
BoSs_S
Huge Clucker
 
BoSs_S's Avatar
 
Join Date: Mar 2011
Posts: 484
Reputation: 5
Default Problema /veh

Buna ziua am incercat sa pun comanda /veh in gm este luata dintr-un FS, cand am pus-o nu mi-a dat erori deloc,cand intru pe server si dau /veh faruri imi apare intr-una un mesaj "Foloseste: /veh [functie]"

uitati comanda :

pawn Code:
if(strcmp(cmd, "/veh", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(gPlayerLogged[playerid] == 0)
            {
                SCM(playerid, COLOR_2RED, "Trebuie sa te loghezi mai intai ca sa poti folosi aceasta comanda ! ");
                return 1;
            }
            new x_nr[256];
            x_nr = strtok(cmdtext, idx);
            if(!strlen(x_nr))
            {
                SendClientMessage(playerid, COLOR_YELLOW2, "Foloseste: /veh [functie]");
                SendClientMessage(playerid, COLOR_BLUE, "Functii: Faruri, Alarma, Capota, Portbagaj, Objective.");
                return 1;
            }
     }
    new engine,lights,alarm,doors,bonnet,boot,objective;
    new veh = GetPlayerVehicleID(playerid);
    if(strcmp(cmd,"Faruri", true) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(veh != INVALID_VEHICLE_ID)
            {
                if(LightsStatus[playerid] == 0)
                {
                    GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(veh,engine,VEHICLE_PARAMS_ON,alarm,doors,bonnet,boot,objective);
                    LightsStatus[playerid] = 1;
                    SendClientMessage(playerid, 0xFFFFFFAA, "{FFFFFF}Ai {2F991A}pornit {FFFFFF} farurile!");
                }
                else if(LightsStatus[playerid] == 1)
                {
                    GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(veh,engine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);
                    LightsStatus[playerid] = 0;
                    SendClientMessage(playerid, 0xFFFFFFAA, "{FFFFFF}Ai {E31919}oprit {FFFFFF} farurile!");
                }
            }
        }
        else {
        SendClientMessage(playerid, 0x00FF00FF, "{E31919}Nu esti in nici o masina!");
        }
    }
    else if(strcmp(cmd,"Alarma", true) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(veh != INVALID_VEHICLE_ID)
            {
                if(AlarmStatus[playerid] == 0)
                {
                    GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(veh,engine,lights,VEHICLE_PARAMS_ON,doors,bonnet,boot,objective);
                    AlarmStatus[playerid] = 1;
                    SendClientMessage(playerid, 0xFFFFFFAA, "{FFFFFF}Ai {2F991A}pornit {FFFFFF} alarma!");
                }
                else if(AlarmStatus[playerid] == 1)
                {
                    GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(veh,engine,lights,VEHICLE_PARAMS_OFF,doors,bonnet,boot,objective);
                    AlarmStatus[playerid] = 0;
                    SendClientMessage(playerid, 0xFFFFFFAA, "{FFFFFF}Ai {E31919}oprit {FFFFFF} alarma!");
                }
            }
        }
        else {
        SendClientMessage(playerid, 0x00FF00FF, "{E31919}Nu esti in nici o masina!");
        }
    }
    else if(strcmp(cmd,"Capota", true) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(veh != INVALID_VEHICLE_ID)
            {
                if(BonnetStatus[playerid] == 0)
                {
                    GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(veh,engine,lights,alarm,doors,VEHICLE_PARAMS_ON,boot,objective);
                    BonnetStatus[playerid] = 1;
                    SendClientMessage(playerid, 0xFFFFFFAA, "{FFFFFF}Ai {2F991A}deschis {FFFFFF} capota!");
                }
                else if(BonnetStatus[playerid] == 1)
                {
                    GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(veh,engine,lights,alarm,doors,VEHICLE_PARAMS_OFF,boot,objective);
                    BonnetStatus[playerid] = 0;
                    SendClientMessage(playerid, 0xFFFFFFAA, "{FFFFFF}Ai {E31919}inchis {FFFFFF} capota!");
                }
            }
        }
        else {
        SendClientMessage(playerid, 0x00FF00FF, "{E31919}Nu esti in nici o masina!");
        }
    }
    else if(strcmp(cmd,"Portbagaj", true) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(veh != INVALID_VEHICLE_ID)
            {
                if(BootStatus[playerid] == 0)
                {
                    GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,VEHICLE_PARAMS_ON,objective);
                    BootStatus[playerid] = 1;
                    SendClientMessage(playerid, 0xFFFFFFAA, "{FFFFFF} Ai {2F991A}deschis {FFFFFF} portbagajul !");
                }
                else if(BootStatus[playerid] == 1)
                {
                    GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,VEHICLE_PARAMS_OFF,objective);
                    BootStatus[playerid] = 0;
                    SendClientMessage(playerid, 0xFFFFFFAA, "{FFFFFF} Ai {E31919}inchis {FFFFFF} portbagajul !");
                }
            }
        }
        else {
        SendClientMessage(playerid, 0x00FF00FF, "{E31919}Nu esti in nici o masina!");
        }
    }
    else if(strcmp(cmd,"Objective", true) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(veh != INVALID_VEHICLE_ID)
            {
                if(ObjectiveStatus[playerid] == 0)
                {
                    GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,VEHICLE_PARAMS_ON);
                    ObjectiveStatus[playerid] = 1;
                    SendClientMessage(playerid, 0xFFFFFFAA, "{FFFFFF}Ai {2F991A}activat {FFFFFF} Obiectivul(CheckPointul)!");
                }
                else if(ObjectiveStatus[playerid] == 1)
                {
                    GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,VEHICLE_PARAMS_OFF);
                    ObjectiveStatus[playerid] = 0;
                    SendClientMessage(playerid, 0xFFFFFFAA, "{FFFFFF}Ai {E31919}dezactivat {FFFFFF} Obiectivul(CheckPointul)!");
                }
            }
        }
        else {
        SendClientMessage(playerid, 0x00FF00FF, "{E31919}Nu esti in nici o masina!");
        }
    }
    else SendClientMessage(playerid, 0xFFFFFFAA, "Foloseste: /veh [functie]"),
    SendClientMessage(playerid, 0xFFFFFFAA, "Functii: Faruri, Alarma, Capota, Portbagaj, Objective.");
    return 1;
}
__________________
[IMG]
BoSs_S is offline  
Old 19/04/2014, 08:48 PM   #2
Noliax8
Banned
 
Join Date: Apr 2012
Location: France, nigga.
Posts: 186
Reputation: 46
Default Re : Problema /veh

Eu nu vorbesc Romana.

Code:
if(strcmp(cmd, "/veh", true) == 0)
{
x_nr = strtok(cmdtext, idx);


... // NU !!!
if(strcmp(cmd,"Faruri", true) == 0)

... // DA !!!
if(strcmp(x_nr ,"Faruri", true) == 0)
}
Goodbye
Noliax8 is offline  
Old 27/04/2014, 12:42 PM   #3
Flashhiee
Gangsta
 
Flashhiee's Avatar
 
Join Date: Mar 2012
Posts: 919
Reputation: 304
Default Re: Problema /veh

Problema este asezare...codurile trebuie puse intr-o anumita ordine, daca nu le pui bine, nu merg bine.

Code:
    new engine,lights,alarm,doors,bonnet,boot,objective;
    new veh = GetPlayerVehicleID(playerid);
    if(strcmp(cmd,"Faruri", true) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(veh != INVALID_VEHICLE_ID)
            {
                if(LightsStatus[playerid] == 0)
                {
                    GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(veh,engine,VEHICLE_PARAMS_ON,alarm,doors,bonnet,boot,objective);
                    LightsStatus[playerid] = 1;
                    SendClientMessage(playerid, 0xFFFFFFAA, "{FFFFFF}Ai {2F991A}pornit {FFFFFF} farurile!");
                }
                else if(LightsStatus[playerid] == 1)
                {
                    GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(veh,engine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);
                    LightsStatus[playerid] = 0;
                    SendClientMessage(playerid, 0xFFFFFFAA, "{FFFFFF}Ai {E31919}oprit {FFFFFF} farurile!");
                }
            }
        }
        else {
        SendClientMessage(playerid, 0x00FF00FF, "{E31919}Nu esti in nici o masina!");
        }
    }
    else if(strcmp(cmd,"Alarma", true) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(veh != INVALID_VEHICLE_ID)
            {
                if(AlarmStatus[playerid] == 0)
                {
                    GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(veh,engine,lights,VEHICLE_PARAMS_ON,doors,bonnet,boot,objective);
                    AlarmStatus[playerid] = 1;
                    SendClientMessage(playerid, 0xFFFFFFAA, "{FFFFFF}Ai {2F991A}pornit {FFFFFF} alarma!");
                }
                else if(AlarmStatus[playerid] == 1)
                {
                    GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(veh,engine,lights,VEHICLE_PARAMS_OFF,doors,bonnet,boot,objective);
                    AlarmStatus[playerid] = 0;
                    SendClientMessage(playerid, 0xFFFFFFAA, "{FFFFFF}Ai {E31919}oprit {FFFFFF} alarma!");
                }
            }
        }
        else {
        SendClientMessage(playerid, 0x00FF00FF, "{E31919}Nu esti in nici o masina!");
        }
    }
    else if(strcmp(cmd,"Capota", true) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(veh != INVALID_VEHICLE_ID)
            {
                if(BonnetStatus[playerid] == 0)
                {
                    GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(veh,engine,lights,alarm,doors,VEHICLE_PARAMS_ON,boot,objective);
                    BonnetStatus[playerid] = 1;
                    SendClientMessage(playerid, 0xFFFFFFAA, "{FFFFFF}Ai {2F991A}deschis {FFFFFF} capota!");
                }
                else if(BonnetStatus[playerid] == 1)
                {
                    GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(veh,engine,lights,alarm,doors,VEHICLE_PARAMS_OFF,boot,objective);
                    BonnetStatus[playerid] = 0;
                    SendClientMessage(playerid, 0xFFFFFFAA, "{FFFFFF}Ai {E31919}inchis {FFFFFF} capota!");
                }
            }
        }
        else {
        SendClientMessage(playerid, 0x00FF00FF, "{E31919}Nu esti in nici o masina!");
        }
    }
    else if(strcmp(cmd,"Portbagaj", true) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(veh != INVALID_VEHICLE_ID)
            {
                if(BootStatus[playerid] == 0)
                {
                    GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,VEHICLE_PARAMS_ON,objective);
                    BootStatus[playerid] = 1;
                    SendClientMessage(playerid, 0xFFFFFFAA, "{FFFFFF} Ai {2F991A}deschis {FFFFFF} portbagajul !");
                }
                else if(BootStatus[playerid] == 1)
                {
                    GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,VEHICLE_PARAMS_OFF,objective);
                    BootStatus[playerid] = 0;
                    SendClientMessage(playerid, 0xFFFFFFAA, "{FFFFFF} Ai {E31919}inchis {FFFFFF} portbagajul !");
                }
            }
        }
        else {
        SendClientMessage(playerid, 0x00FF00FF, "{E31919}Nu esti in nici o masina!");
        }
    }
    else if(strcmp(cmd,"Objective", true) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(veh != INVALID_VEHICLE_ID)
            {
                if(ObjectiveStatus[playerid] == 0)
                {
                    GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,VEHICLE_PARAMS_ON);
                    ObjectiveStatus[playerid] = 1;
                    SendClientMessage(playerid, 0xFFFFFFAA, "{FFFFFF}Ai {2F991A}activat {FFFFFF} Obiectivul(CheckPointul)!");
                }
                else if(ObjectiveStatus[playerid] == 1)
                {
                    GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,VEHICLE_PARAMS_OFF);
                    ObjectiveStatus[playerid] = 0;
                    SendClientMessage(playerid, 0xFFFFFFAA, "{FFFFFF}Ai {E31919}dezactivat {FFFFFF} Obiectivul(CheckPointul)!");
                }
            }
        }
        else {
        SendClientMessage(playerid, 0x00FF00FF, "{E31919}Nu esti in nici o masina!");
        }
    }
    else SendClientMessage(playerid, 0xFFFFFFAA, "Foloseste: /veh [functie]"),
    SendClientMessage(playerid, 0xFFFFFFAA, "Functii: Faruri, Alarma, Capota, Portbagaj, Objective.");
Codurile astea trebuie puse imediat dupa:
Code:
            if(!strlen(x_nr))
            {
                SendClientMessage(playerid, COLOR_YELLOW2, "Foloseste: /veh [functie]");
                SendClientMessage(playerid, COLOR_BLUE, "Functii: Faruri, Alarma, Capota, Portbagaj, Objective.");
                return 1;
            }
__________________
My maps:
The Hell - Space Station[Module I] - Mansion Interior - Mining Village - Desert Village

I create custom maps of any kind, more details on discord at UnuAlex#6567
Flashhiee is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 11:34 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.