Very dumb question
#6

pawn Код:
CMD:ann(playerid, params[]) {
    // Replace 'IsPlayerAdmin(playerid)' with a check for your scripts admin levels.
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFFFF00AA, "You are not an admin or do not retain the sufficient power to execute this command.");

    if(isnull(params)) return SendClientMessage(playerid, 0xFFFF00AA, "Usage: /ann [announcement]");
   
    SendClientMessageToAll(0xFFFF00AA, params);
    return 1;
}

CMD:startfs(playerid, params[]) {
    // Replace 'IsPlayerAdmin(playerid)' with a check for your scripts admin levels.
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFFFF00AA, "You are not an admin or do not retain the sufficient power to execute this command.");

    if(isnull(params)) return SendClientMessage(playerid, 0xFFFF00AA, "Usage: /startfs [filterscript]");

    new
        szCommand[128]; // Arbitrary size as I'm unsure of the size of your FS names...
       
    format(szCommand, sizeof(szCommand), "loadfs %s", params);
    SendRconCommand(szCommand);
    return 1;
}
Snipa's example won't work - he's parsing the FS name to an integer which just won't work. Here's two (efficient) examples for both of the commands as you requested. You'll need the isnull function.
Reply


Messages In This Thread
Very dumb question - by anumaz - 17.03.2011, 11:13
Re: Very dumb question - by antonio112 - 17.03.2011, 11:45
Re: Very dumb question - by Snipa - 17.03.2011, 14:23
Re: Very dumb question - by anumaz - 17.03.2011, 20:34
Re: Very dumb question - by maramizo - 17.03.2011, 20:39
Re: Very dumb question - by Calgon - 17.03.2011, 20:44
Re: Very dumb question - by anumaz - 17.03.2011, 21:03
Re: Very dumb question - by anumaz - 17.03.2011, 21:58

Forum Jump:


Users browsing this thread: 1 Guest(s)