SA-MP Forums Archive
Help , REP+ - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help , REP+ (/showthread.php?tid=558289)



Help , REP+ - JakeHunter1 - 16.01.2015

pawn Код:
if(strcmp(cmd,"/sklado",true)==0)
    {
        new Playername[24];
        GetPlayerName(playerid, Playername, sizeof(Playername));
        if(strcmp(Playername,"Nick_Youa",true) || strcmp(Playername, "Baba_Nacka", true))
        {
            SendClientMessage(playerid, COLOR_WHITE, "{F81414}GRESKA:{FFFFFF}You dont have key from this gate.");
        }
        else
        {
            SendClientMessage(playerid, COLOR_WHITE, "{37F906}INFO:{FFFFFF}You opened the gate.");
            MoveObject(skladkapija,-2.3000000,-268.7000100,-2.9000000, 2);
        }
   return 1;
   }
Is everythink good in this command ? Couse it says i dont have a key ..


Re: Help , REP+ - ATGOggy - 16.01.2015

Only this:
PHP код:
if(strcmp(cmdtext,"/sklado",true)==



Re: Help , REP+ - HY - 16.01.2015

pawn Код:
if(strcmp(cmd,"/sklado",true)==0)
    {
        new Playername[24];
        GetPlayerName(playerid, Playername, sizeof(Playername));
        if(!strcmp(Playername,"Nick_Youa",true) || !strcmp(Playername, "Baba_Nacka", true))
        {
            SendClientMessage(playerid, COLOR_WHITE, "{F81414}GRESKA:{FFFFFF}You dont have key from this gate.");
        }
        else
        {
            SendClientMessage(playerid, COLOR_WHITE, "{37F906}INFO:{FFFFFF}You opened the gate.");
            MoveObject(skladkapija,-2.3000000,-268.7000100,-2.9000000, 2);
        }
   return 1;
   }



Re: Help , REP+ - xVIP3Rx - 16.01.2015

You're asking ?
It seems ok, but depends on how do you want it do, it seems that it checks if player name equal "Nick_Youa" or "Baba_Nicka", and open a gate.

Quote:
Originally Posted by ATGOggy
Посмотреть сообщение
Only this:
PHP код:
if(strcmp(cmdtext,"/sklado",true)==
What's wrong with that ?
At least explain to him with your post.


Re: Help , REP+ - ATGOggy - 16.01.2015

Quote:
Originally Posted by HY
Посмотреть сообщение
pawn Код:
if(strcmp(cmd,"/sklado",true)==0)
    {
        new Playername[24];
        GetPlayerName(playerid, Playername, sizeof(Playername));
        if(!strcmp(Playername,"Nick_Youa",true) || !strcmp(Playername, "Baba_Nacka", true))
        {
            SendClientMessage(playerid, COLOR_WHITE, "{F81414}GRESKA:{FFFFFF}You dont have key from this gate.");
        }
        else
        {
            SendClientMessage(playerid, COLOR_WHITE, "{37F906}INFO:{FFFFFF}You opened the gate.");
            MoveObject(skladkapija,-2.3000000,-268.7000100,-2.9000000, 2);
        }
   return 1;
   }
In your code, this line is wrong:
PHP код:
if(!strcmp(Playername,"Nick_Youa",true) || !strcmp(Playername"Baba_Nacka"true)) 
It should be
PHP код:
if(strcmp(Playername,"Nick_Youa",true) || strcmp(Playername"Baba_Nacka"true))