Commands Problem
#1

Quote:

CMD:rickroll(playerid, params[])
{
if(IsPlayerAdmin(playerid)) {
new PlayerID; //The variable for the Player ID you put in for the player we want to Rick Roll.
new reason[64]; //The reason for the Rick Roll.
new str[128]; //Our variable for a message string.
new pName[MAX_PLAYER_NAME], adName[MAX_PLAYER_NAME]; //Defines the function with the player name you want to get.
GetPlayerName(playerid, adName, sizeof(adName)); //Defines the function with the admin name you want to get.
GetPlayerName(playerid, pName, sizeof(pName));
if(sscanf(params, "us[64]", PlayerID,reason)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /rickroll [playerid] [reason]"); //Tell SSCANF if the parameters/the syntax is written wrong to return a message (PlayerID and the reason used here)

if(!IsPlayerConnected(PlayerID)) //If the ID is wrong or not connected, return the message below:
return SendClientMessage(playerid, COLOR_GREY, "Player is not connected!");

format(str, sizeof(str), "'%s' has been Rick Roll'd by Administrator '%s'. Reason: %s ", pName, adName, reason); //format the string we've defined to send the message, playername and adminname are used to receive the information about the names
SendClientMessageToAll(LIGHTGREEN, str); //Send the message we formatted with format using the str variable we declared/made.
PlayAudioStreamForPlayer(PlayerID, "http://www.geekspeakradio.us/jocofullinterview41.mp3"); //Play the Rick Roll song. (Never Gonna Give You Up - Rick Astley.)
GameTextForPlayer(PlayerID, "~r~You have been Rick Roll'd by an Admin!", 4000, 3); //Send a message to the players screen.
SetPlayerHealth(PlayerID, 100.0); //Set the players health to %30.
}
else //If he isn't logged into RCON, then do:
{
SendClientMessage(playerid, COLOR_DBLUE, "You need to be an RCON Admin to use that command!"); //Send this message if they are not RCON.
}
return 1;
}

I want Remove rcon system.
Reply
#2

pawn Код:
CMD:rickroll(playerid, params[])
{
new PlayerID; //The variable for the Player ID you put in for the player we want to Rick Roll.
new reason[64]; //The reason for the Rick Roll.
new str[128]; //Our variable for a message string.
new pName[MAX_PLAYER_NAME], adName[MAX_PLAYER_NAME]; //Defines the function with the player name you want to get.
GetPlayerName(playerid, adName, sizeof(adName)); //Defines the function with the admin name you want to get.
GetPlayerName(playerid, pName, sizeof(pName));
if(sscanf(params, "us[64]", PlayerID,reason)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /rickroll [playerid] [reason]"); //Tell SSCANF if the parameters/the syntax is written wrong to return a message (PlayerID and the reason used here)

if(!IsPlayerConnected(PlayerID)) //If the ID is wrong or not connected, return the message below:
return SendClientMessage(playerid, COLOR_GREY, "Player is not connected!");

format(str, sizeof(str), "'%s' has been Rick Roll'd by Administrator '%s'. Reason: %s ", pName, adName, reason); //format the string we've defined to send the message, playername and adminname are used to receive the information about the names
SendClientMessageToAll(LIGHTGREEN, str); //Send the message we formatted with format using the str variable we declared/made.
PlayAudioStreamForPlayer(PlayerID, "http://www.geekspeakradio.us/jocofullinterview41.mp3"); //Play the Rick Roll song. (Never Gonna Give You Up - Rick Astley.)
GameTextForPlayer(PlayerID, "~r~You have been Rick Roll'd by an Admin!", 4000, 3); //Send a message to the players screen.
SetPlayerHealth(PlayerID, 100.0); //Set the players health to %30.
return 1;
}
Rcon admin removed.
Note: Anyone can use this command now, is that what you wanted?
If you wanted your own variable (example: PlayerInfo[playerid][pAdmin] >= 5, replace the "IsPlayerAdmin(playerid)" to that...)
Reply
#3

thanks i wanted only admin can do that.
Reply
#4

I want one another thing?

if a admin rick roll a player

then in main chat show that msg to all.

[18:35:27] 'ScarFace' has been Rick Roll'd by Administrator 'ScarFace'. Reason: Bitch.

but I want make it like this.

[18:35:27] 'ScarFace' has been Rick Roll'd by Administrator. Reason: Bitch.

and i want 1 cmd too , admin can rick roll all player who online on serevr.
Reply
#5

Well whats your variable for the admin ranks (PlayerInfo[playerid][pAdmin] ?) What is it & what rank do you want the administrator to use to proceed using this command?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)