How to make Helpers,etc..?
#5

Mean, changing the reason to a number won't do anything.
First off, this won't work with the sscanf 2.0 plugin because strings must have a length, so the command should be
pawn Код:
CMD:kick(playerid, params[])
{
    if(helper[playerid] == 0) return SendClientMessage(playerid, 0xAAAAAA, "You need to be helper to use this");
    new giveplayerid, reason[20];
    if(sscanf(params, "us[20]", giveplayerid, reason)) return SendClientMessage(playerid, 0xAAAAAA, "Usage: /kick [ID] [Reason]");
//If you want the reason to be optional, replace the "us[20]" above with "uS[20]"
    new string[128];
    new pName[24], aName[24];
    GetPlayerName(playerid, aName, 24);
    GetPlayerName(giveplayerid, pName, 24);
    format(string, sizeof(string), "Admin %s has kicked %s. Reason: %s", aName, pName, reason);
    //If you made the reason optional, replace the above line with this one:
    //format(string, sizeof(string), "Admin %s has kicked %s. %s%s", aName, pName, reason[0] ? ("[Reason:]") : (" "), reason);
    SendClientMessageToAll(0xAAAAAA, string);
    Kick(giveplayerid);
    return 1;
}
Reply


Messages In This Thread
How to make Helpers,etc..? - by Wooza - 29.01.2011, 13:18
Re: How to make Helpers,etc..? - by Mean - 29.01.2011, 15:55
Re: How to make Helpers,etc..? - by Wooza - 29.01.2011, 17:36
Re: How to make Helpers,etc..? - by Mean - 29.01.2011, 19:57
Re: How to make Helpers,etc..? - by randomkid88 - 29.01.2011, 20:36
[No subject] - by Wooza - 30.01.2011, 13:57

Forum Jump:


Users browsing this thread: 1 Guest(s)