SA-MP Forums Archive
unknown command problem +rep - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: unknown command problem +rep (/showthread.php?tid=537430)



unknown command problem +rep - KillerStrike23 - 15.09.2014

i made a cmds command and i got an error which is line is too long and issue got fixed, but another problem happened which is when i tested that cmd i got that its unkown cmd :

pawn Код:
CMD:cmds(playerid,params[]){
    new info2[1111];
    strcat(info2, "{FFFFFF}/go [id] to teleport to someone /gos to disable it\n/pm [id] [message] for private message and /pms to disable it\n/changename for name changing\n/countdown to start a count down\n/saveskin [skinid] /useskin /dontuseskin to save and use the skin you want\n");
    strcat(info2, "{FFFFFF}/veh or /lvehicle to spawn temp cars\n/vmenu for vehicle commands\n/bmenu for bussiness commands\nhmenu for house commands\n/admins to know online administrators");
    ShowPlayerDialog(playerid, DIALOGID3+54, DIALOG_STYLE_MSGBOX, "{FF0000}SFTDM - Commands", info2, "Next","Exit");}
   
CMD:cmds2(playerid,params[]){
    new info3[1111];
    strcat(info3, "{FFFFFF}/color to change your name color\n/fstyles to change your fighting style\n/kill to retared your own self\n/anims for a list of the anims you can use\n");
    strcat(info3, "{FFFFFF}/teleports for a list of current tps\n/call to make a phone call /answer to answer one /hangup to shut the line\n/telebank to go to bank\n/night and /day to change your own time\n/w for whispering /cw to talk to others in car");
    ShowPlayerDialog(playerid, 2461, DIALOG_STYLE_MSGBOX, "{FF0000}SFTDM - Commands", info3, "Exit","");}



Re: unknown command problem +rep - IamPRO - 15.09.2014

Try returning to 1. and using 3 strcat for both info2 and info3.
pawn Код:
CMD:cmds(playerid,params[]){
    new info2[1111];
    strcat();//this line seems long to me. So divide the info 2 in 3 parts.
    strcat();  
    strcat();
    ShowPlayerDialog(playerid, DIALOGID3+54, DIALOG_STYLE_MSGBOX, "{FF0000}SFTDM - Commands", info2, "Next","Exit");
    return 1;//returning to 1
}
   
CMD:cmds2(playerid,params[]){
    new info3[1111];
    strcat(//half message here.);
    strcat(//half here);
    strcat(//half here);
    ShowPlayerDialog(playerid, 2461, DIALOG_STYLE_MSGBOX, "{FF0000}SFTDM - Commands", info3, "Exit","");
    return 1;//returning to 1
}



Re: unknown command problem +rep - AroseKhanNiazi - 15.09.2014

pawn Код:
CMD:cmds(playerid)
{
    new info2[500];
    format(info2(sizeof(info2),"{FFFFFF}/go [id] to teleport to someone /gos to disable it\n/pm [id] [message] for private message and /pms to disable it\n/changename");
    format(info2(sizeof(info2),"%s for name changing\n/countdown to start a count down\n/saveskin [skinid] /useskin /dontuseskin to save and use the skin you want\n",info2)
    format(info2(sizeof(info2),"%s{FFFFFF}/veh or /lvehicle to spawn temp cars\n/vmenu for vehicle commands\n/bmenu for bussiness commands\nhmenu for house commands\n/admins to know online administrators",info2);
    ShowPlayerDialog(playerid, DIALOGID3+54, DIALOG_STYLE_MSGBOX, "{FF0000}SFTDM - Commands", info2, "Next","Exit");
    return 1;
}
   
CMD:cmds2(playerid)
{
    new info3[500];
    format(info3(sizeof(info3),"{FFFFFF}/color to change your name color\n/fstyles to change your fighting style\n/kill to retared your own self\n/anims for a list of the anims you can use\n{FFFFFF}/teleports for a list of current tps\n/call to make a phone call");
    format(info3(sizeof(info3), "%s /answer to answer one /hangup to shut the line\n/telebank to go to bank\n/night and /day to change your own time\n/w for whispering /cw to talk to others in car",info3);
    ShowPlayerDialog(playerid, 2461, DIALOG_STYLE_MSGBOX, "{FF0000}SFTDM - Commands", info3, "Exit","");
    return 1;
}
now why i used the format way ? well coz i like it and i use it in my script.
why changed the cell size of info2 and info3 cheacked the string length it was 434 for the first command and less than that for other so no need for 11k it will just lag and it returns that command is not executed if u don't add return 1; or add return 0;