Text Parameter?
#1

How would I create a command with a text parameter?

e.g. /goto lossantos and /goto sanfierro

I don't want you to create that command for me. Could some just create a blank script for me which has a text parameter?
Reply
#2

use dcmd+sscanf , its the best for parameters
Reply
#3

Without any other function
pawn Код:
if(strcmp("command", cmdtext[1], true, 7) && (cmdtext[8] == 32 || cmdtext[8] == EOS))
{
    if(cmdtext[8] != 32 || cmdtext[9] == EOS)
        return SendClientMessage(playerid, 0xFFFFFFAA, "Right Usage: /command [text]");
    //the text would be "cmdtext[9]"
    return 1;
}
Dcmd
pawn Код:
//OnPlayerCommandText
dcmd(command, 7, cmdtext); //7 is the length of "command"
pawn Код:
dcmd_command(playerid, parameter[])
{
    if(parameter[0] == EOS)
        return SendClientMessage(playerid, 0xFFFFFFAA, "Right Usage: /command [text]");
    //the text would be "parameter"
}
Zcmd
pawn Код:
cmd_command(playerid, parameter[])
{
    if(parameter[0] == EOS)
        return SendClientMessage(playerid, 0xFFFFFFAA, "Right Usage: /command [text]");
    //the text would be "parameter"
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)