/setgm
#1

Solved
Reply
#2

any help i have to go soon.....
Reply
#3

can u send what u has for ur /setgm please
Reply
#4

Solved
Reply
#5

realize this is not exactly what you wanted but it helps

have no tested but compiles fine

pawn Код:
//AT TOP OF ONPLAYERCOMMANDTEXT

        new tmp[256],cmd[256],idx;
    cmd = strtok(cmdtext,idx);
    tmp = strtok(cmdtext,idx);

if(!strcmp(cmd,"/Setgm",true))
    {
        if(IsPlayerAdmin(playerid))
        {
            if(!strlen(tmp)||strval(tmp)<0||strval(tmp)>3) return SendClientMessage(playerid,COLOR_MESSAGES,"USEAGE: /Setgm [1 - 3]");
            switch(strval(tmp))
            {
                case 1:
                {
                    SendRconCommand("changemode Race 1");
                    SendRconCommand("changemode");
                }
                case 2:
                {
                    SendRconCommand("changemode Race 2");
                    SendRconCommand("changemode");
                }
                case 3:
                {
                    SendRconCommand("changemode Race 3");
                    SendRconCommand("changemode");
                }
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR, "You are NOT an admin");
        }
        return 1;
    }
reply if works or not
Reply
#6

* willsuckformoney forgot this put this at bottom of script

pawn Код:
strtok(const string[], &index)
{
    new length = strlen(string);
    while ((index < length) && (string[index] <= ' '))
    {
        index++;
    }

    new offset = index;
    new result[20];
    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
    {
        result[index - offset] = string[index];
        index++;
    }
    result[index - offset] = EOS;
    return result;
}
Reply
#7

thanks it works and i already had the strtok
Reply
#8

wow it really worked? lol i tested it on mine and it fail lol maybe cuz i edited it a little ^^
Reply
#9

Solved
Reply
#10

cool lol
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)