how to
#1

Hey guys, I have this command
pawn Код:
if(strcmp(cmd, "/setmode", true) == 0) {
SendRconCommand("changemode lvdm");
return 1;
}
I want to do it like /setmode [gamemodename]

How to do this? :P
thanks
Reply
#2

Not sure it works, but should.

And btw, this kind of command can't return a error message saying that the gamemode hasn't been found

pawn Код:
if(strcmp(cmd, "/setmode", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
        tmp = strtok(cmdtext,idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid,COLOR_WHITE,"   USAGE: /setmode [gamemode name]");
            return 1;
        }
        new string[128]; // Remove this if you already have it defined
        format(string,sizeof(string),"changemode %s",tmp);
        SendRconCommand(string);
    }
    return 1;
}
Reply
#3

Thanks!, Code works fine,
Reply
#4

Dude ... Read your previous thread first before creating a new one.
I supplied you with a working command right there.

http://forum.sa-mp.com/showpost.php?...7&postcount=14
Reply
#5

OW vince. My appologizes. I didn't notice you made a /changemode [name].
I'm really sorry.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)