Quote:
Originally Posted by newbie scripter
pawn Код:
CMD:goto(playerid, params[]) { if(!strcmp("sf", params, true, 2)) { // SF tp cmd } if(!strcmp("ls", params, true, 2)) { // LS tp cmd } if(!strcmp("lv", params, true, 2)) { // LV tp cmd } return 1; }
|
Those were the exact lines i needed, thanks buddy. +rep.
Quote:
Originally Posted by pds2k12
I am using y_stringhash & y_commands because it's easier for you, instead of using strcmp to compare strings, nothing special in this code.
pawn Код:
YCMD:goto(playerid, params[], help) { if(help) { SendClientMessage(playerid, -1, "SF | LS | LV"); SendClientMessage(playerid, -1, "/goto [Location"); } switch ( YHash( params ), false ) //parameter | YHash(str[], bool:sensitive = true, e_HASH_TYPE:type = bernstein); { case _H<LS>: { //ls coordinates. } case _H<LV>: { //lv coordinates. } case _H<SF>: { //sf coordinates. } }
return 1; }
EDIT
You could use that but it would not show you any message how to use the command.
|
Thanks for the assistance,
+rep