Jump to content
  • 0

Comanda /getcar si /gotocar


QuickSilver

Question

Salutare,sunt incepator si as vrea putin ajutor..la comanda getcar si gotocar..deci am incercat si nu mi.a iesit sa fac un text la amandoua de exp la getcar:[Admin/Nume]a adus la el masina cu id[id/Masina] si la gotocar "[Admin/Nume] s-a teleportat la masina cu id[id/Masina] ma poate ajuta cineva??:)

/GETCAR

[pawn] if(strcmp(cmd, "/getcar", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /getcar [carid]");

return 1;

}

new Float:plocx,Float:plocy,Float:plocz;

new plo;

plo = strval(tmp);

            if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pAgent] >= 4)

{

GetPlayerPos(playerid, plocx, plocy, plocz);

SetVehiclePos(plo,plocx,plocy+4, plocz);

}

else

{

SendClientMessage(playerid, COLOR_GRAD1, "  nu esti autorizat sa folosesti aceasta comanda!");

}

}

return 1;

}[/pawn]

/GOTOCAR

[pawn] if(strcmp(cmd, "/gotocar", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /gotocar [carid]");

return 1;

}

new testcar = strval(tmp);

if (PlayerInfo[playerid][pAdmin] >= 1)

{

    if(PlayerInfo[playerid][pJailed] == 1)

            {

                SendClientMessage(playerid,COLOR_GREY,"  Nu poti folosi aceasta comanda daca esti la inchisoare !");

                return 1;

            }

new Float:cwx2,Float:cwy2,Float:cwz2;

GetVehiclePos(testcar, cwx2, cwy2, cwz2);

if (GetPlayerState(playerid) == 2)

{

new tmpcar = GetPlayerVehicleID(playerid);

SetVehiclePos(tmpcar, cwx2, cwy2, cwz2);

TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;

}

else

{

SetPlayerPos(playerid, cwx2, cwy2, cwz2);

}

SendClientMessage(playerid, COLOR_GRAD1, "  Te-ai teleportat la vehicul cu succes!!");

SetPlayerInterior(playerid,0);

}

else

{

SendClientMessage(playerid, COLOR_GRAD1, "  Nu esti autorizat sa folosesti aceasta comanda!");

}

}

return 1;

}[/pawn]

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

Poftim, nu am incercat sa iti pun si "Model Vehicle"

/getcar

[pawn]

        if(strcmp(cmd, "/getcar", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /getcar [carid]");

return 1;

}

new Float:plocx,Float:plocy,Float:plocz;

new plo;

new plo2;

plo = strval(tmp),GetPlayerName(plo, giveplayer, sizeof(giveplayer));

                        if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pAgent] >= 4)

{

GetPlayerPos(playerid, plocx, plocy, plocz);

SetVehiclePos(plo,plocx,plocy+4, plocz);

                                format(string, sizeof(string), "{0099FF}[iNFO]{FFFFFF}: Admin %s a adus la el Masina cu {0099FF}[iD CAR: %d]",sendername,plo,plo2);

                ABroadCast(COLOR_LIGHTRED,string, 5);

}

else

{

SendClientMessage(playerid, COLOR_GRAD1, "  Nu esti autorizat sa folosesti aceasta comanda!");

}

}

return 1;

}

[/pawn]

/gotocar

[pawn]

        if(strcmp(cmd, "/gotocar", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /gotocar [carid]");

return 1;

}

new testcar = strval(tmp);

if (PlayerInfo[playerid][pAdmin] >= 1)

{

                            if(PlayerInfo[playerid][pJailed] == 1)

                            {

                                SendClientMessage(playerid,COLOR_GREY,"  Nu poti folosi aceasta comanda daca esti la inchisoare !");

                                return 1;

                            }

new Float:cwx2,Float:cwy2,Float:cwz2;

GetVehiclePos(testcar, cwx2, cwy2, cwz2);

if (GetPlayerState(playerid) == 2)

{

new tmpcar = GetPlayerVehicleID(playerid);

SetVehiclePos(tmpcar, cwx2, cwy2, cwz2);

TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;

}

else

{

SetPlayerPos(playerid, cwx2, cwy2, cwz2);

}

                                format(string, sizeof(string), "{0099FF}[iNFO]{FFFFFF}: Admin %s a folosit comanda /gotocar la masina cu {0099FF}[iD CAR: %d]{FFFFFF}!",sendername,testcar);

                ABroadCast(COLOR_LIGHTRED,string, 5);

SetPlayerInterior(playerid,0);

}

else

{

SendClientMessage(playerid, COLOR_GRAD1, "  Nu esti autorizat sa folosesti aceasta comanda!");

}

}

return 1;

}

[/pawn]

Link to comment
Share on other sites

Foarte bun..doar ca mai trebuia adaugat : [pawn]GetPlayerName(playerid, sendername, sizeof(sendername));[/pawn] in fata la codul tau pentru a se vedea numele adminului

/gotocar complet

[pawn]      if(strcmp(cmd, "/gotocar", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /gotocar [carid]");

return 1;

}

new testcar = strval(tmp);

if (PlayerInfo[playerid][pAdmin] >= 1)

{

                            if(PlayerInfo[playerid][pJailed] == 1)

                            {

                                SendClientMessage(playerid,COLOR_GREY,"  Nu poti folosi aceasta comanda daca esti la inchisoare !");

                                return 1;

                            }

new Float:cwx2,Float:cwy2,Float:cwz2;

GetVehiclePos(testcar, cwx2, cwy2, cwz2);

if (GetPlayerState(playerid) == 2)

{

new tmpcar = GetPlayerVehicleID(playerid);

SetVehiclePos(tmpcar, cwx2, cwy2, cwz2);

TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;

}

else

{

SetPlayerPos(playerid, cwx2, cwy2, cwz2);

}

                    GetPlayerName(playerid, sendername, sizeof(sendername));

                    format(string, sizeof(string), "{0099FF}[iNFO]{FFFFFF}: Admin %s a folosit comanda /gotocar la masina cu {0099FF}[iD CAR: %d]{FFFFFF}!",sendername,testcar);

                    ABroadCast(COLOR_LIGHTRED,string, 5);

    SetPlayerInterior(playerid,0);

}

else

{

SendClientMessage(playerid, COLOR_GRAD1, "  Nu esti autorizat sa folosesti aceasta comanda!");

}

}

return 1;

}[/pawn]

/getcar complet

[pawn]      if(strcmp(cmd, "/getcar", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /getcar [carid]");

return 1;

}

new Float:plocx,Float:plocy,Float:plocz;

new plo;

new plo2;

plo = strval(tmp),GetPlayerName(plo, giveplayer, sizeof(giveplayer));

                        if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pAgent] >= 4)

{

                GetPlayerName(playerid, sendername, sizeof(sendername));

GetPlayerPos(playerid, plocx, plocy, plocz);

SetVehiclePos(plo,plocx,plocy+4, plocz);

                format(string, sizeof(string), "{0099FF}[iNFO]{FFFFFF}: Admin %s a adus la el Masina cu {0099FF}[iD CAR: %d]",sendername,plo,plo2);

                ABroadCast(COLOR_LIGHTRED,string, 5);

}

else

{

SendClientMessage(playerid, COLOR_GRAD1, "  Nu esti autorizat sa folosesti aceasta comanda!");

}

}

return 1;

}[/pawn]

Ms mult WaZP :)

PS:Puteti inchide topicul

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.