SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 27/04/2012, 03:37 AM   #1
Beastlynoob
Little Clucker
 
Beastlynoob's Avatar
 
Join Date: Apr 2011
Posts: 48
Reputation: 0
Exclamation Unknown Command problem,please help.

My server just started sayin unknown command to all commands such as:

if (strcmp("/commands", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid, COLOR_YELLOW, "Phonecmds: /sms (number)(message) /call /phonebook ");
SendClientMessage(playerid, COLOR_PINK, "RPcmds: /me /do");
SendClientMessage(playerid, COLOR_GREEN, "Teleportcmds: /gotolift /gotoraft");
SendClientMessage(playerid, COLOR_GREEN, "Misc_CMDs: /r /giveobject (Coming Soon) /setsail (1-3)");
SendClientMessage(playerid, COLOR_GREEN, "Misc_CMDs 2: /sendtohub /sendtoearth /pr0anims ");
return 1;
}

and i cant find any reason why,please help
Beastlynoob is offline   Reply With Quote
Old 27/04/2012, 03:39 AM   #2
Ballu Miaa
High-roller
 
Ballu Miaa's Avatar
 
Join Date: Apr 2010
Location: New Delhi,India
Posts: 1,849
Reputation: 323
Default Re: Unknown Command problem,please help.

Your OnPlayerCommandText callback is returning 1? Post your whole OnPlayerCommandText callback here. using the BB Code [ pawn ] [ /pawn ]
__________________


I will take half payment as an advance to script for you.
Click here to request my Scripting Service.

Ballu Miaa is offline   Reply With Quote
Old 27/04/2012, 03:41 AM   #3
Beastlynoob
Little Clucker
 
Beastlynoob's Avatar
 
Join Date: Apr 2011
Posts: 48
Reputation: 0
Default Re: Unknown Command problem,please help.

pawn Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/commands", cmdtext, true, 10) == 0)
    {
         SendClientMessage(playerid, COLOR_YELLOW, "Phonecmds: /sms (number)(message) /call /phonebook /pickup /hangup");
         SendClientMessage(playerid, COLOR_RED, "Resourcecmds: /(carname /weaponspawn(it will freeze you in position,enter cmd again and press enter)");
         SendClientMessage(playerid, COLOR_PINK, "RPcmds: /me /do");
         SendClientMessage(playerid, COLOR_GREEN, "Teleportcmds: /gotolift /gotoraft");
         SendClientMessage(playerid, COLOR_GREEN, "Misc_CMDs: /r /giveobject (Coming Soon) /setsail (1-3) /returnsail ");
         SendClientMessage(playerid, COLOR_GREEN, "Misc_CMDs 2: /sendtohub /sendtoearth /pr0anims ");
         return 1;
    }
    if (strcmp("/setsail", cmdtext, true, 10) == 0)
    {
        new string[50];
        new movetime = MoveObject(ship, -1446.8108, 714.5275, 0.3152, 5.00);
        format(string, sizeof(string), "All Aboard! Destination: SF Dock", movetime);
        SendClientMessage(playerid, 0xFF000000, string);
        return 1;
    }
    if (strcmp("/returnsail", cmdtext, true, 10) == 0)
    {
        new string[50];
        new movetime = MoveObject(ship, -754.2696, 630.3597, 0.1278, 10.00);
        format(string, sizeof(string), "Return Voyage! Destination: Raft Home", movetime);
        SendClientMessage(playerid, 0xFF000000, string);
        return 1;
    }
    if (strcmp("/gotolift", cmdtext, true, 10) == 0)
    {
     SetPlayerPos(playerid,-1090.969482, -1011.279175, 128.153824);
     return 1;
    }
    if (strcmp("/gotoraft", cmdtext, true, 10) == 0)
    {
     SetPlayerPos(playerid,-754.2696, 630.3597, 1.1278);
     return 1;
    }
    if (strcmp("/sendtohub", cmdtext, true, 10) == 0)
    {
     MoveObject(rocket, -1090.969482, -1011.279175, 774.153824, 3);
     SendClientMessage(playerid, 0xDEEE20FF, "Destination: TG Hub");
     return 1;
    }
    if (strcmp("/sendtoearth", cmdtext, true, 10) == 0)
    {
     MoveObject(rocket, -1090.969482, -1011.279175, 128.153824, 5);
     SendClientMessage(playerid, 0xDEEE20FF, "Destination: San Andreas");
     return 1;
    }
    if (strcmp("/setsail2", cmdtext, true, 10) == 0)
    {
        new string[50];
        new movetime = MoveObject(ship, 238.4816, 160.1856, 2.9297, 5.00);
        format(string, sizeof(string), "All Aboard! Destination: Countryside town", movetime);
        SendClientMessage(playerid, 0xFF000000, string);
        return 1;
    }
    if (strcmp("/setsail3", cmdtext, true, 10) == 0)
    {
        new string[50];
        new movetime = MoveObject(ship, 1624.4229, 568.0103, 2.9297, 5.00);
        format(string, sizeof(string), "All Aboard! Destination: LV Dock", movetime);
        SendClientMessage(playerid, 0xFF000000, string);
        return 1;
    }
    if (strcmp("/rules", cmdtext, true, 10) == 0)
    {
         SendClientMessageToAll(0xB8860BAA, "Do not shoot random players/admins.");
         SendClientMessageToAll(0xB8860BAA, "Do not use hacks. Admins only!");
         SendClientMessageToAll(0xB8860BAA, " Do not fight/argue with another player.");
         SendClientMessageToAll(0xB8860BAA, " Do not ram and/or steal.");
         SendClientMessageToAll(0xB8860BAA, "NO BOTS!(unless level 4-5)");
         return 1;
    }
    return 0;
   
   
}

sorry if its sloppy im still a bit of a noob
Beastlynoob is offline   Reply With Quote
Old 27/04/2012, 03:54 AM   #4
Ballu Miaa
High-roller
 
Ballu Miaa's Avatar
 
Join Date: Apr 2010
Location: New Delhi,India
Posts: 1,849
Reputation: 323
Default Re: Unknown Command problem,please help.

Allright i fixed it. Replace this callback with you'rs in the script.

pawn Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/commands", cmdtext, true) == 0)
    {
         SendClientMessage(playerid, COLOR_YELLOW, "Phonecmds: /sms (number)(message) /call /phonebook /pickup /hangup");
         SendClientMessage(playerid, COLOR_RED, "Resourcecmds: /(carname /weaponspawn(it will freeze you in position,enter cmd again and press enter)");
         SendClientMessage(playerid, COLOR_PINK, "RPcmds: /me /do");
         SendClientMessage(playerid, COLOR_GREEN, "Teleportcmds: /gotolift /gotoraft");
         SendClientMessage(playerid, COLOR_GREEN, "Misc_CMDs: /r /giveobject (Coming Soon) /setsail (1-3) /returnsail ");
         SendClientMessage(playerid, COLOR_GREEN, "Misc_CMDs 2: /sendtohub /sendtoearth /pr0anims ");
         return 1;
    }
    if (strcmp("/setsail", cmdtext, true) == 0)
    {
        new string[50];
        new movetime = MoveObject(ship, -1446.8108, 714.5275, 0.3152, 5.00);
        format(string, sizeof(string), "All Aboard! Destination: SF Dock", movetime);
        SendClientMessage(playerid, 0xFF000000, string);
        return 1;
    }
    if (strcmp("/returnsail", cmdtext, true) == 0)
    {
        new string[50];
        new movetime = MoveObject(ship, -754.2696, 630.3597, 0.1278, 10.00);
        format(string, sizeof(string), "Return Voyage! Destination: Raft Home", movetime);
        SendClientMessage(playerid, 0xFF000000, string);
        return 1;
    }
    if (strcmp("/gotolift", cmdtext, true) == 0)
    {
     SetPlayerPos(playerid,-1090.969482, -1011.279175, 128.153824);
     return 1;
    }
    if (strcmp("/gotoraft", cmdtext, true) == 0)
    {
     SetPlayerPos(playerid,-754.2696, 630.3597, 1.1278);
     return 1;
    }
    if (strcmp("/sendtohub", cmdtext, true) == 0)
    {
     MoveObject(rocket, -1090.969482, -1011.279175, 774.153824, 3);
     SendClientMessage(playerid, 0xDEEE20FF, "Destination: TG Hub");
     return 1;
    }
    if (strcmp("/sendtoearth", cmdtext, true) == 0)
    {
     MoveObject(rocket, -1090.969482, -1011.279175, 128.153824, 5);
     SendClientMessage(playerid, 0xDEEE20FF, "Destination: San Andreas");
     return 1;
    }
    if (strcmp("/setsail2", cmdtext, true) == 0)
    {
        new string[50];
        new movetime = MoveObject(ship, 238.4816, 160.1856, 2.9297, 5.00);
        format(string, sizeof(string), "All Aboard! Destination: Countryside town", movetime);
        SendClientMessage(playerid, 0xFF000000, string);
        return 1;
    }
    if (strcmp("/setsail3", cmdtext, true) == 0)
    {
        new string[50];
        new movetime = MoveObject(ship, 1624.4229, 568.0103, 2.9297, 5.00);
        format(string, sizeof(string), "All Aboard! Destination: LV Dock", movetime);
        SendClientMessage(playerid, 0xFF000000, string);
        return 1;
    }
    if (strcmp("/rules", cmdtext, true) == 0)
    {
         SendClientMessageToAll(0xB8860BAA, "Do not shoot random players/admins.");
         SendClientMessageToAll(0xB8860BAA, "Do not use hacks. Admins only!");
         SendClientMessageToAll(0xB8860BAA, " Do not fight/argue with another player.");
         SendClientMessageToAll(0xB8860BAA, " Do not ram and/or steal.");
         SendClientMessageToAll(0xB8860BAA, "NO BOTS!(unless level 4-5)");
         return 1;
    }
    SendClientMessage(playerid, COLOR_GREY, "Either your not using the command properly, or the command is invalid!");
    return 1;
}
__________________


I will take half payment as an advance to script for you.
Click here to request my Scripting Service.

Ballu Miaa is offline   Reply With Quote
Old 27/04/2012, 03:54 AM   #5
RollTi
Huge Clucker
 
RollTi's Avatar
 
Join Date: Apr 2012
Location: Philippines
Posts: 229
Reputation: 36
Default Re: Unknown Command problem,please help.

never tired to try this?

pawn Code:
if(!strcmp("/nameofcommand", cmdtext, true))
__________________
if you notice me posting in topic that has 'REP+' i'm just want to help other people not to get reputation


New Release [INC]: roAFK - Efficient AFK System (Latest!)
RollTi is offline   Reply With Quote
Old 27/04/2012, 04:10 AM   #6
Beastlynoob
Little Clucker
 
Beastlynoob's Avatar
 
Join Date: Apr 2011
Posts: 48
Reputation: 0
Default Re: Unknown Command problem,please help.

It still isnt working,i even removed all filterscripts to see if that was the problem
Beastlynoob is offline   Reply With Quote
Old 27/04/2012, 04:19 AM   #7
Ballu Miaa
High-roller
 
Ballu Miaa's Avatar
 
Join Date: Apr 2010
Location: New Delhi,India
Posts: 1,849
Reputation: 323
Default Re: Unknown Command problem,please help.

Quote:
Originally Posted by Beastlynoob View Post
It still isnt working,i even removed all filterscripts to see if that was the problem
Used the callback i gave you?
__________________


I will take half payment as an advance to script for you.
Click here to request my Scripting Service.

Ballu Miaa is offline   Reply With Quote
Old 27/04/2012, 04:26 AM   #8
Beastlynoob
Little Clucker
 
Beastlynoob's Avatar
 
Join Date: Apr 2011
Posts: 48
Reputation: 0
Default Re: Unknown Command problem,please help.

Yes,i fixed it (somehow?) i just moved the whole callback into a filterscript and removed it from the gm.
Beastlynoob is offline   Reply With Quote
Old 27/04/2012, 05:48 AM   #9
Mark™
Guest
 
Posts: n/a
Default Re: Unknown Command problem,please help.

Quote:
Originally Posted by Beastlynoob View Post
My server just started sayin unknown command to all commands such as:

if (strcmp("/commands", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid, COLOR_YELLOW, "Phonecmds: /sms (number)(message) /call /phonebook ");
SendClientMessage(playerid, COLOR_PINK, "RPcmds: /me /do");
SendClientMessage(playerid, COLOR_GREEN, "Teleportcmds: /gotolift /gotoraft");
SendClientMessage(playerid, COLOR_GREEN, "Misc_CMDs: /r /giveobject (Coming Soon) /setsail (1-3)");
SendClientMessage(playerid, COLOR_GREEN, "Misc_CMDs 2: /sendtohub /sendtoearth /pr0anims ");
return 1;
}

and i cant find any reason why,please help
pawn Code:
if (strcmp("/commands", cmdtext, true, 9) == 0) // string count for /commands would be 9, not 10
    {
         SendClientMessage(playerid, COLOR_YELLOW, "Phonecmds: /sms (number)(message) /call /phonebook ");
         SendClientMessage(playerid, COLOR_PINK, "RPcmds: /me /do");
         SendClientMessage(playerid, COLOR_GREEN, "Teleportcmds: /gotolift /gotoraft");
         SendClientMessage(playerid, COLOR_GREEN, "Misc_CMDs: /r /giveobject (Coming Soon) /setsail (1-3)");
         SendClientMessage(playerid, COLOR_GREEN, "Misc_CMDs 2: /sendtohub /sendtoearth /pr0anims ");
                return 1;
    }
/ 1
c 2
o 3
m 4
m 5
a 6
n 7
d 8
s 9
  Reply With Quote
Old 27/04/2012, 02:26 PM   #10
SuperViper
High-roller
 
SuperViper's Avatar
 
Join Date: Sep 2011
Posts: 1,177
Reputation: 315
Default Re: Unknown Command problem,please help.

You might have included zcmd at the top of your script. That could be it.
SuperViper is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unknown command - Problem InferNus` Scripting Help 5 10/02/2012 03:37 AM
Unknown Command Problem - Any Help Please? 15outland Scripting Help 4 07/11/2011 10:41 AM
SERVER: unknown command problem hardstop Help Archive 2 27/05/2010 04:41 PM
Problem :S Unknown Command R3SpaWn3 Help Archive 18 11/04/2010 05:42 PM


All times are GMT. The time now is 11:02 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.