/help doesn't work!
#1

Hi!

I've created a command, but not in CMD! When a normal player types /help, the information should be shown!

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
     if(strcmp(cmdtext[0], "/help"))
     {
        SendClientMessage(playerid, COLOR_RED, "Hi there! Welcome to Gangwars and Ganglife at Night ");
        SendClientMessage(playerid, COLOR_RED, "The most gang-banging in Los Angeles are happening at night!");
        SendClientMessage(playerid, COLOR_RED, "Now it's your turn! Choose your favourite gang and show, that you and your homies are the best!");
        SendClientMessage(playerid, COLOR_RED, "Remember, you can't betray your gang!");
        SendClientMessage(playerid, COLOR_RED, "Use every situation to attack your enemies! Your target is, to take over whole Los Santos with your gang!");
       
        return 1;
     }
 
    return 0;
}
Reply
#2

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
     if(strcmp(cmdtext, "/help", true) == 0)
     {
        SendClientMessage(playerid, COLOR_RED, "Hi there! Welcome to Gangwars and Ganglife at Night ");
        SendClientMessage(playerid, COLOR_RED, "The most gang-banging in Los Angeles are happening at night!");
        SendClientMessage(playerid, COLOR_RED, "Now it's your turn! Choose your favourite gang and show, that you and your homies are the best!");
        SendClientMessage(playerid, COLOR_RED, "Remember, you can't betray your gang!");
        SendClientMessage(playerid, COLOR_RED, "Use every situation to attack your enemies! Your target is, to take over whole Los Santos with your gang!");
        return 1;
     }
 
    return 0;
}
i'm not really sure..
Reply
#3

Nice, but it didn't work!
What could it be? Should I put a ! before strcmp?
Reply
#4

any help

I'm getting crazy I need this command!
Reply
#5

I suggest you to download Zcmd.

And on the top:

pawn Код:
#include <zcmd>
And put this Zcmd command anywhere in script you would like.

pawn Код:
COMMAND:help(playerid, params[])
{
    SendClientMessage(playerid, COLOR_RED, "Hi there! Welcome to Gangwars and Ganglife at Night ");
    SendClientMessage(playerid, COLOR_RED, "The most gang-banging in Los Angeles are happening at night!");
    SendClientMessage(playerid, COLOR_RED, "Now it's your turn! Choose your favourite gang and show, that you and your homies are the best!");
    SendClientMessage(playerid, COLOR_RED, "Remember, you can't betray your gang!");
    SendClientMessage(playerid, COLOR_RED, "Use every situation to attack your enemies! Your target is, to take over whole Los Santos with your gang!");
    return 1;
}
This must work if you put it correctly.

And there is no bugs/errors.

Thanks

Davz~
Reply
#6

I got zcmd, I only didn't know how to do it with zcmd^^ thanks
Reply
#7

You got Team viewer? Or something i could help you on that. :0
Reply
#8

look on the difference:
your:
pawn Код:
if(strcmp(cmdtext[0], "/help"))
his script :
pawn Код:
if(strcmp(cmdtext, "/help", true) == 0)
the line is not done yet..
you need to finish the line...if you want it to work..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)