Help , REP+
#1

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 ..
Reply
#2

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

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;
   }
Reply
#4

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.
Reply
#5

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)) 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)