Jump to content
  • 0

Cum fac o comanda personala?


Question

Posted

Salut...am si eu o intrebare (prima mea intrebare) cum fac o comanda personala de ex cand cineva scrie /opendoor numai el sa o poata deschide...sunt f curiossi chiar miar folosi [pawn]public OnPlayerCommandText(playerid, cmdtext[])

{

    if (strcmp(cmdtext, "/og1", true)==0)

    {

        MoveObject(autogate1,751.18389893,-2356.89355469,10.16450500, 5.5);

        SetTimer("GateClose", 3000, false);

        SendClientMessage(Roby_Jones, COLOR_LIGHTGREEN,"Bine ai venit acas'!");

        return 1;

    }

    if (strcmp(cmdtext, "/og1", true)==0)

    {

        MoveObject(autogate1,751.18389893,-2356.89355469,10.16450500, 5.5);

        SetTimer("GateClose", 3000, false);

        SendClientMessage(Boby_Jones, COLOR_CYAN,"Bine ai venit acas'!");

        return 1;

    }

    if(strcmp(cmdtext, "/od1", true)==0)

    {

    if(strcmp(PlayerName, "Roby_Jones", true) == 0)

        MoveObject(autogate2, 795.49414062,-2255.80834961,50.79106140,5.5);

        SetTimer("GateClose", 3000, false);

        return 1;

    }

    if(strcmp(cmdtext, "/od1", true)==0)

    {

    if(strcmp(PlayerName, "Boby_Jones", true) == 0)

        MoveObject(autogate2, 795.49414062,-2255.80834961,50.79106140,5.5);

        SetTimer("GateClose", 3000, false);

        return 1;

    }

return 0;

}[/pawn]

Poate va ajuta asta multumesc !

1 answer to this question

Recommended Posts

Posted

www.wiki.sa-mp.com/wiki/strcmp

Ceva de genu:

new name[ MAX_PLAYER_NAME ];
GetPlayerName( playerid, name, MAX_PLAYER_NAME );
if ( strcmp( name, "xxSPEEDYxx", true ) == 0 ) {

//Alte coduri, daca gaseste numele "xxSPEEDYxx"

} else {

//Daca nu gaseste numele ca fiind "xxSPEEDYxx"

Fara reclama in semnatura!

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.