Jump to content
  • 0

Cum fac o comanda pe rcon administrator ?


Papana

Question

Vreau sa stiu si eu cum fac o comanda pentru /rcon login [pass]

nu daca am admin asa

vreau sa stiu si eu

am toate comenzile pe sistemu de admin si unele le-as vrea asa :D

De exemplu imi puteti explica la aceasta comanda:

	if(strcmp(cmd, "/makeadmin", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /makeadmin [playerid/PartOfName] [level(1-3)]");
				return 1;
			}
			new para1;
			new level;
			para1 = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			level = strval(tmp);
			if(PlayerInfo[playerid][pAdmin] >= 7)
			{
			    if(IsPlayerConnected(para1))
			    {
			        if(para1 != INVALID_PLAYER_ID)
			        {
						GetPlayerName(para1, giveplayer, sizeof(giveplayer));
						GetPlayerName(playerid, sendername, sizeof(sendername));
						PlayerInfo[para1][pAdmin] = level;
						printf("AdmCmd: %s has promoted %s to a level %d admin.", sendername, giveplayer, level);
						format(string, sizeof(string), "   You have been promoted to a level %d admin by %s", level, sendername);
						SendClientMessage(para1, COLOR_WHITE, string);
						format(string, sizeof(string), "   You have promoted %s to a level %d admin.", giveplayer,level);
						SendClientMessage(playerid, COLOR_WHITE, string);
					}
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD1, "   Nu esti autorizat sa folosesti aceasta comanda!");
			}
		}
		return 1;
	}

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

Scuze pentru dublu post

dar cand dau edit da eroare la pagina  :|

dar am gasit pe wiki.sa-mp.com

public OnRconCommand(cmd[])
{
    if(!strcmp(cmd,"Hello",true))
    {
        SendClientMessageToAll(0xFFFFFFAA,"Hello World!");
        print("You said hello to the world.");// This will appear to the player who typed the rcon command in the chat in white
        return 1;
    }
    return 0;
}

sa inteleg ca,comenzi le fac aici pt rcon ?

public OnRconCommand(cmd[])

Link to comment
Share on other sites

[pawn]if(strcmp(cmd, "/mycmd", true) == 0)

{

    if(IsPlayerAdmin(playerid))

    {

        //Restul codului pentru comanda respectiva

    }

    else return SendClientMessage(playerid, 0xFF0000AA, "ERROR: Nu esti RCON Admin!");

}[/pawn]

Functia [pawn]IsPlayerAdmin(playerid)[/pawn] este folosita pentru a detecta daca jucator-ul care a folosit comanda respectiva este RCON Admin.

3r4AlPA.png

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.