PDA

View Full Version : [HELP] Unkown Command finish


Thedya
18/11/2011, 03:52 AM
else
{
SendClientMessage(playerid, COLOR_RED, "Wrong place.");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "You are not a cop.");
return 1;
}
}//not connected
return 1;
}

//car system
new pos, funcname[32];
while(cmdtext[++pos] > ' ')
{
funcname[pos-1] = tolower(cmdtext[pos]);
}
strins(funcname, "cmd_", 0, sizeof(funcname));
while (cmdtext[pos] == ' ') pos++;
if(!cmdtext[pos])
{
return CallLocalFunction(funcname, "is", playerid, "\1");
}
return CallLocalFunction(funcname, "is", playerid, cmdtext[pos]);
//car system


}



guys this i my 'usercommandtext' finish line.

now at this position, how can i change 'Unknown Command' text to what i want ? i cant find 'return 0' for change to return SendClientMessage(playerid,COLOR_BLUE,"Whoaa!! Wrong Command!! Try /cmds for some help.");
}

antonio112
18/11/2011, 04:00 AM
Replace the
return 1;


from your function, with the desired message. Example:


return SendClientMessage(playerid, -1, "Wrong command.");

Thedya
18/11/2011, 12:45 PM
does not happen :/ i gotta crayz.

}
else
{
SendClientMessage(playerid, COLOR_RED, "you are not a cop.");
return 1;
}
}
return SendClientMessage(playerid, -1, "Wrong command.");
}


//car system

antonio112
18/11/2011, 12:51 PM
You must have something like:

public OnPlayerCommandText(playerid, cmdtext[])
{
return 0;
}


Replace the last 'return' with:

return SendClientMessage(playerid, -1, "This command does not exist in our database.");


or whatever you want the message.

Thedya
18/11/2011, 12:56 PM
yep i understand but i dont have any 'return 0' under public onplayercommandtext. I send here my public's last line. and this is public start.

public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(specplayer, 10, cmdtext);
dcmd(specoff, 7, cmdtext);
new string[256];
new playermoney;
new sendername[MAX_PLAYER_NAME];
new giveplayer[MAX_PLAYER_NAME];
new playername[MAX_PLAYER_NAME];
new cmd[256];
new tmp[256];
new giveplayerid, moneys, idx;
new idcar = GetPlayerVehicleID(playerid);
new pveh = GetVehicleModel(GetPlayerVehicleID(playerid));
cmd = strtok(cmdtext, idx);


if(strcmp(cmd, "/dekor", true) == 0 || strcmp(cmd, "/dek", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new house = PlayerInfo[playerid][pPhousekey];
GetPlayerName(playerid, playername, sizeof(playername));
if (house != 999 && strcmp(playername, HouseInfo[PlayerInfo[playerid][pPhousekey]][hOwner], true) == 0)
{


public is 16.000 line.

antonio112
18/11/2011, 01:14 PM
Holy ... Well, still, look for the last return, right before the last closed bracket:

public OnPlayerCommandText(playerid, cmdtext[])
{
//bla bla bla 15999 lines here

return 1; // This is the return you need to change.
}


Or just copy your OnCommandText on pastebin and give me a link... I'll fix it for you.

Thedya
18/11/2011, 02:09 PM
allright, im going to upload my usercommandtext, pastepin doesnt accept because of line limit.