Unknow Command,simple cmd.
#1

PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
    if (
strcmp("/help"cmdtexttrue10) == 0)
    {
        
SendClientMessage(playerid0x33AA33AA"|_____________________________GENERAL HELP_______________________________________|");
        
SendClientMessage(playerid0xFFFFFFAA"[CHAT]:/b /g(OOC) /low /s(Shout) /d(Donator) /w(Whisper) /me /do /pm");
        
SendClientMessage(playerid0xFFFFFFAA"[IGHELP]:/admins /helpers /ask /report");
        
SendClientMessage(playerid0xFFFFFFAA"[ATM]:/withdraw /deposit /checkbalance");
        
SendClientMessage(playerid0xFFFFFFAA"[GENERAL]:/enter(To enter places) /exit(to exit places) /animhelp /coin /windows");
        
SendClientMessage(playerid0xFFFFFFAA"[GENERAL]:/stats /vampirehelp /admins /v /wolfhelp /collegehelp /cellphonehelp /dice");
        
SendClientMessage(playerid0xFFFFFFAA"[GENERAL]:/hh /househelp /charity /pay /clearchat /dropgun /buyitems /buyaccessories");
        
SendClientMessage(playerid0xFFFFFFAA"[JOBS]: /fishinghelp /teaherhelp");
        
SendClientMessage(playerid0x33AA33AA"|________________________________________________________________________________|");
        return 
1;
    }
    else if (
strcmp("/dropgun"cmdtexttrue10) == 0)
    {
        new 
weaponid GetPlayerWeapon(playerid);
        
GivePlayerWeapon(playerid,weaponid,-1);
         return 
1;
    }
    else if (
strcmp("/clearchat"cmdtexttrue10) == 0)
    {
        
SendClientMessage(playerid,0xFFFFFF,"");
        
SendClientMessage(playerid,0xFFFFFF,"");
        
SendClientMessage(playerid,0xFFFFFF,"");
        
SendClientMessage(playerid,0xFFFFFF,"");
        
SendClientMessage(playerid,0xFFFFFF,"");
        
SendClientMessage(playerid,0xFFFFFF,"");
        
SendClientMessage(playerid,0xFFFFFF,"");
        
SendClientMessage(playerid,0xFFFFFF,"");
        
SendClientMessage(playerid,0xFFFFFF,"");
        
SendClientMessage(playerid,0xFFFFFF,"");
        return 
1;
    }
    else if (
strcmp("/cellphonehelp"cmdtexttrue10) == 0)
    {
        
SendClientMessage(playerid0x33AA33AA"|___________CELLPHONE HELP________|");
        
SendClientMessage(playerid0xFFFFFFAA"[CELLPHONEHELP]:/call /hangup");
        
SendClientMessage(playerid0x33AA33AA"|_________________________________|");
        return 
1;
    }
    else if (
strcmp("/teacherhelp"cmdtexttrue10) == 0)
    {
        
SendClientMessage(playerid0x33AA33AA"|_____________TEACHER HELP__________|");
         
SendClientMessage(playerid0xFFFFFFAA"[TEACHERHELP]:/startclass /endclass");
          
SendClientMessage(playerid0x33AA33AA"|___________________________________|");
           return 
1;
    }
    if (
strcmp("/househelp"cmdtexttrue10) == 0)
    {
           
SendClientMessage(playerid0x33AA33AA"|_______________HOUSE HELP______________________|");
        
SendClientMessage(playerid0xFFFFFFAA"[HOUSEHELP]:/enter /exit /buyhouse /sellhouse");
        
SendClientMessage(playerid0x33AA33AA"|_______________________________________________|");
        return 
1;
    }
    if (
strcmp("/charity"cmdtexttrue10) == 0)
    {
        
ShowPlayerDialog(playerid,100,DIALOG_STYLE_INPUT"Charity""How much would you like to charity""Charity""Close");
        return 
1;
    }
    return 
0;

I don't know why /help and other cmds and not working.
Reply
#2

Delete the else before the if .
Reply
#3

Try Following.. if helped +REP please :P

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/help", true))
    {
        SendClientMessage(playerid, 0x33AA33AA, "|_____________________________GENERAL HELP_______________________________________|");
        SendClientMessage(playerid, 0xFFFFFFAA, "[CHAT]:/b /g(OOC) /low /s(Shout) /d(Donator) /w(Whisper) /me /do /pm");
        SendClientMessage(playerid, 0xFFFFFFAA, "[IGHELP]:/admins /helpers /ask /report");
        SendClientMessage(playerid, 0xFFFFFFAA, "[ATM]:/withdraw /deposit /checkbalance");
        SendClientMessage(playerid, 0xFFFFFFAA, "[GENERAL]:/enter(To enter places) /exit(to exit places) /animhelp /coin /windows");
        SendClientMessage(playerid, 0xFFFFFFAA, "[GENERAL]:/stats /vampirehelp /admins /v /wolfhelp /collegehelp /cellphonehelp /dice");
        SendClientMessage(playerid, 0xFFFFFFAA, "[GENERAL]:/hh /househelp /charity /pay /clearchat /dropgun /buyitems /buyaccessories");
        SendClientMessage(playerid, 0xFFFFFFAA, "[JOBS]: /fishinghelp /teaherhelp");
        SendClientMessage(playerid, 0x33AA33AA, "|________________________________________________________________________________|");
        return 1;
    }
    if(!strcmp(cmdtext, "/dropgun", true))
    {
        new weaponid = GetPlayerWeapon(playerid);
        GivePlayerWeapon(playerid,weaponid,-1);
         return 1;
    }
    if(!strcmp(cmdtext, "/clearchat", true))
    {
        SendClientMessage(playerid,0xFFFFFF,"");
        SendClientMessage(playerid,0xFFFFFF,"");
        SendClientMessage(playerid,0xFFFFFF,"");
        SendClientMessage(playerid,0xFFFFFF,"");
        SendClientMessage(playerid,0xFFFFFF,"");
        SendClientMessage(playerid,0xFFFFFF,"");
        SendClientMessage(playerid,0xFFFFFF,"");
        SendClientMessage(playerid,0xFFFFFF,"");
        SendClientMessage(playerid,0xFFFFFF,"");
        SendClientMessage(playerid,0xFFFFFF,"");
        return 1;
    }
    if(!strcmp(cmdtext, "/cellphonehelp", true))
    {
        SendClientMessage(playerid, 0x33AA33AA, "|___________CELLPHONE HELP________|");
        SendClientMessage(playerid, 0xFFFFFFAA, "[CELLPHONEHELP]:/call /hangup");
        SendClientMessage(playerid, 0x33AA33AA, "|_________________________________|");
        return 1;
    }
    if(!strcmp(cmdtext, "/teacherhelp", true))
    {
        SendClientMessage(playerid, 0x33AA33AA, "|_____________TEACHER HELP__________|");
         SendClientMessage(playerid, 0xFFFFFFAA, "[TEACHERHELP]:/startclass /endclass");
          SendClientMessage(playerid, 0x33AA33AA, "|___________________________________|");
           return 1;
    }
    if(!strcmp(cmdtext, "/househelp", true))
    {
           SendClientMessage(playerid, 0x33AA33AA, "|_______________HOUSE HELP______________________|");
        SendClientMessage(playerid, 0xFFFFFFAA, "[HOUSEHELP]:/enter /exit /buyhouse /sellhouse");
        SendClientMessage(playerid, 0x33AA33AA, "|_______________________________________________|");
        return 1;
    }
    if(!strcmp(cmdtext, "/charity", true))
    {
        ShowPlayerDialog(playerid,100,DIALOG_STYLE_INPUT, "Charity", "How much would you like to charity", "Charity", "Close");
        return 1;
    }
    return 0;
}
Reply
#4

Quote:
Originally Posted by Jarnu
Посмотреть сообщение
Try Following.. if helped +REP please :P

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/help", true))
    {
        SendClientMessage(playerid, 0x33AA33AA, "|_____________________________GENERAL HELP_______________________________________|");
        SendClientMessage(playerid, 0xFFFFFFAA, "[CHAT]:/b /g(OOC) /low /s(Shout) /d(Donator) /w(Whisper) /me /do /pm");
        SendClientMessage(playerid, 0xFFFFFFAA, "[IGHELP]:/admins /helpers /ask /report");
        SendClientMessage(playerid, 0xFFFFFFAA, "[ATM]:/withdraw /deposit /checkbalance");
        SendClientMessage(playerid, 0xFFFFFFAA, "[GENERAL]:/enter(To enter places) /exit(to exit places) /animhelp /coin /windows");
        SendClientMessage(playerid, 0xFFFFFFAA, "[GENERAL]:/stats /vampirehelp /admins /v /wolfhelp /collegehelp /cellphonehelp /dice");
        SendClientMessage(playerid, 0xFFFFFFAA, "[GENERAL]:/hh /househelp /charity /pay /clearchat /dropgun /buyitems /buyaccessories");
        SendClientMessage(playerid, 0xFFFFFFAA, "[JOBS]: /fishinghelp /teaherhelp");
        SendClientMessage(playerid, 0x33AA33AA, "|________________________________________________________________________________|");
        return 1;
    }
    if(!strcmp(cmdtext, "/dropgun", true))
    {
        new weaponid = GetPlayerWeapon(playerid);
        GivePlayerWeapon(playerid,weaponid,-1);
         return 1;
    }
    if(!strcmp(cmdtext, "/clearchat", true))
    {
        SendClientMessage(playerid,0xFFFFFF,"");
        SendClientMessage(playerid,0xFFFFFF,"");
        SendClientMessage(playerid,0xFFFFFF,"");
        SendClientMessage(playerid,0xFFFFFF,"");
        SendClientMessage(playerid,0xFFFFFF,"");
        SendClientMessage(playerid,0xFFFFFF,"");
        SendClientMessage(playerid,0xFFFFFF,"");
        SendClientMessage(playerid,0xFFFFFF,"");
        SendClientMessage(playerid,0xFFFFFF,"");
        SendClientMessage(playerid,0xFFFFFF,"");
        return 1;
    }
    if(!strcmp(cmdtext, "/cellphonehelp", true))
    {
        SendClientMessage(playerid, 0x33AA33AA, "|___________CELLPHONE HELP________|");
        SendClientMessage(playerid, 0xFFFFFFAA, "[CELLPHONEHELP]:/call /hangup");
        SendClientMessage(playerid, 0x33AA33AA, "|_________________________________|");
        return 1;
    }
    if(!strcmp(cmdtext, "/teacherhelp", true))
    {
        SendClientMessage(playerid, 0x33AA33AA, "|_____________TEACHER HELP__________|");
         SendClientMessage(playerid, 0xFFFFFFAA, "[TEACHERHELP]:/startclass /endclass");
          SendClientMessage(playerid, 0x33AA33AA, "|___________________________________|");
           return 1;
    }
    if(!strcmp(cmdtext, "/househelp", true))
    {
           SendClientMessage(playerid, 0x33AA33AA, "|_______________HOUSE HELP______________________|");
        SendClientMessage(playerid, 0xFFFFFFAA, "[HOUSEHELP]:/enter /exit /buyhouse /sellhouse");
        SendClientMessage(playerid, 0x33AA33AA, "|_______________________________________________|");
        return 1;
    }
    if(!strcmp(cmdtext, "/charity", true))
    {
        ShowPlayerDialog(playerid,100,DIALOG_STYLE_INPUT, "Charity", "How much would you like to charity", "Charity", "Close");
        return 1;
    }
    return 0;
}
Easy to steal code? I was first with the solution and u copy my solution?
Reply
#5

Thanks everyone.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)