Helpers
#1

if i put dis command in my server,if i type /admins it show's the name but not the admin names?

it's dis commands.


Код:
COMMAND:sethelper(playerid, params[])
{
    new pID, str[128];
    if(!IsPlayerAdmin(playerid))
    return SendClientMessage(playerid, -1, "Only admins can use this command.");
    if(sscanf(params,"u", pID))
    return SendClientMessage(playerid,-1,"USAGE: /sethelper [PlayerID]");
    if(!IsPlayerConnected(pID))
    return SendClientMessage(playerid, -1, "ERROR: Selected player is not connected.");
    if(APlayerData[playerid][Helper])
    return SendClientMessage(playerid, -1, "Selected player is a helper already.");
    new name[MAX_PLAYER_NAME+1], pName[MAX_PLAYER_NAME+1];
    GetPlayerName(pID, name, sizeof name);
    GetPlayerName(playerid, pName, sizeof pName);
    if(APlayerData[playerid][Helper])
    format(str, sizeof str, "Admin %s made you a helper.", pName);
    SendClientMessage(pID, -1, str);
    format(str, sizeof str, "You made %s a helper.", name);
    SendClientMessage(playerid, -1, str);
    // Let the server know that this was a valid command
    return 1;
}
COMMAND:unsethelper(playerid, params[])
{
    new pID, str[128];
    if(!IsPlayerAdmin(playerid))
    return SendClientMessage(playerid, -1, "Only admins can use this command.");
    if(sscanf(params,"u", pID))
    return SendClientMessage(playerid,-1,"USAGE: /unsethelper [PlayerID]");
    if(!IsPlayerConnected(pID))
    return SendClientMessage(playerid, -1, "ERROR: Selected player is not connected.");
    if(APlayerData[playerid][Helper])
    return SendClientMessage(playerid, -1, "Selected player is not helper.");
    new name[MAX_PLAYER_NAME+1], pName[MAX_PLAYER_NAME+1];
    GetPlayerName(pID, name, sizeof name);
    GetPlayerName(playerid, pName, sizeof pName);
    playerHelper[pID] = false;
    format(str, sizeof str, "Admin %s made you a regular player.", pName);
    SendClientMessage(pID, -1, str);
    format(str, sizeof str, "You made %s a regular player.", name);
    SendClientMessage(playerid, -1, str);
    // Let the server know that this was a valid command
    return 1;
}
Reply
#2

Please explain better what's your problem.
Reply
#3

"show's the name but not the admin names" Not sure what you mean by this...? Also can you please supply the /admins command?
Reply
#4

i fixed it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)