How to make Helpers,etc..?
#1

Hey,I need someone to give me the script to make helpers,and all of this? and if I can know how to make a script that there I can make people a rank ? and if I can have the script of /new where u can ask questions
Reply
#2

So you want to make a helper?
Ok.
Using SSCANF and ZCMD, and is only for RCON admins:
pawn Код:
new helper[MAX_PLAYERS];

CMD:sethelper(playerid, params[])
{
    if(!IsPlayerAdmin(playerid))
        return 0;
    new giveplayerid;
    if(sscanf(params, "u", giveplayerid))
        return SendClientMessage(playerid, 0xAAAAAA, "Usage: /sethelper [ID]");
    helper[giveplayerid] = 1;
    new string[128];
    new pName[24], aName[24];
    GetPlayerName(playerid, aName, 24);
    GetPlayerName(giveplayerid, pName, 24);
    format(string, sizeof(string), "You have made %s a helper", pName);
    SendClientMessage(playerid, 0xAAAAAA, string);
    format(string, sizeof(string), "Administrator %s has made you a helper", aName);
    SendClientMessage(giveplayerid, 0xAAAAAA, string);
    return 1;
}
Now you make commands for helpers, example KICK command:
pawn Код:
CMD:kick(playerid, params[])
{
    if(helper[playerid] == 0)
        return SendClientMessage(playerid, 0xAAAAAA, "You need to be helper to use this");
    new giveplayerid;
    if(sscanf(params, "u", giveplayerid))
        return SendClientMessage(playerid, 0xAAAAAA, "Usage: /kick [ID]");
    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", aName, pName);
    SendClientMessageToAll(0xAAAAAA, string);
    Kick(giveplayerid);
    return 1;
}


Ranks:
pawn Код:
new rank[MAX_PLAYERS];

public OnPlayerSpawn(playerid)
{
    if(GetPlayerScore(playerid) > 300)
    {
        SendClientMessage(playerid, 0xAAAAAA, "Current rank: 2");
        rank[playerid] = 2;
    }
    // Etc...
    return 1;
}
Enjoy!
Reply
#3

Thanks! But can you tell me how do I add reason? to my commands like [ID] has been kicked from the server by admin [ID] [Reason:]
And this is when im trying to compile the cmds u gave me:error 054: unmatched closing brace ("}")
D:\GTA.San.Andreas mor55 + shlomix.co.il\pawno\vo.pwn.pwn(587 : warning 203: symbol is never used: "kick"
D:\GTA.San.Andreas mor55 + shlomix.co.il\pawno\vo.pwn.pwn(587 : warning 203: symbol is never used: "sethelper"
Reply
#4

You put it under OnPlayerCommandText, delete your OnPlayerCommandText function and put commands anywhere in your script.
EDIT: here is /kick [id] [reason]:

pawn Код:
CMD:kick(playerid, params[])
{
    if(helper[playerid] == 0)
        return SendClientMessage(playerid, 0xAAAAAA, "You need to be helper to use this");
    new giveplayerid, reason;
    if(sscanf(params, "us", giveplayerid, reason))
        return SendClientMessage(playerid, 0xAAAAAA, "Usage: /kick [ID] [Reason]");
    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);
    SendClientMessageToAll(0xAAAAAA, string);
    Kick(giveplayerid);
    return 1;
}
NOT TESTED

If it doesn't work change:
pawn Код:
if(sscanf(params, "us", giveplayerid, reason))
        return SendClientMessage(playerid, 0xAAAAAA, "Usage: /kick [ID] [Reason]");
To:
pawn Код:
if(sscanf(params, "ud", giveplayerid, reason))
        return SendClientMessage(playerid, 0xAAAAAA, "Usage: /kick [ID] [Reason]");
And change:
pawn Код:
format(string, sizeof(string), "Admin %s has kicked %s. Reason: %s", aName, pName, reason);
to
pawn Код:
format(string, sizeof(string), "Admin %s has kicked %s. Reason: %d", aName, pName, reason);
BUT ONLY IF IT DOESN'T WORK!
Reply
#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
#6

I am sorry but I can't success at this, please someone can privatley guide me?

Please someone?

Please this is urgent someone can help me personally add my skype: sahar14511 or msn: szion8@hotmail.com

Ok Thanks, but I want to add a reason alone without thek ick command like I wanna add a reason like to any cmd I want.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)