Demote player on teleport
#1

Hello, I am making a punishment were theres a little house far out to sea, I am not sure how to do this but I want ONLY level 5 admins (highest level on my server), to type /housepun [ID]. This will make the player who the admin selected go to this house.
When the player gets teleported there, I would like there admin level to go to 0, just until they die.


The location of the house.

Код:
694.7562,-2377.2427,-0.0825,84.5652
Thanks.
Reply
#2

pawn Код:
CMD:housepun(playerid,params[])
{
      new Player;
      if(!IsPlayerAdmin(playerid))
{
      if(sscanf,params, "u", Player)) return SendClientMessage(playerid,RED,"Usage: /housepun [id]);
      else if(Player == INVALID_PLAYER_ID) retunr SendClientMessage(playerid,RED,"
Player is not connected");
      else
      {
           AllowPlayerTeleport(playerid,true);
           SetPlayerPosition(playerid,694.7562,-2377.2427,-0.0825);
           GameTextForPlayer(playerid,"
You have been punished by admin",7500,4);
      }
      return 1;
}
}
Ok listen I don't even know if it's working and if this is what you want just try it,ONLY as idea and if it's working tell me mroe exactly what you wanna do OK?
Reply
#3

I don't understand I may do it for you but what do you mean by demoting player ,you mean if u sue that command on a player that's admin you want him demoted?
Reply
#4

he means if any player go there and he demote automiac
Reply
#5

If the player is an admin who is getting sent to the punishment, I want that player to get demoted just until he dies (demoted to level 0)
Reply
#6

ok i'll make it simple ok?
Reply
#7

And make the command like this?

pawn Код:
if(strcmp("/housepun", cmdtext, true) == 0)
And thanks, my script is using strcmp
Reply
#8

pawn Код:
dcmd_housepun(playerid,params[]) {
    if(PlayerInfo[playerid][Level] = 5) {
        if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: /housepun [playerid]");
        new player1 = strval(params), string[128];
        if(PlayerInfo[player1][Level] == ServerInfo[MaxAdminLevel] && PlayerInfo[playerid][Level] != ServerInfo[MaxAdminLevel]) return SendClientMessage(playerid,RED,"ERROR: You cannot use this command on this admin");
        if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID) {
            CMDMessageToAdmins(playerid,"HOUSEPUN");
            format(string, sizeof(string), "You have punished \"%s\" ", pName(player1)); SendClientMessage(playerid,blue,string);
            if(player1 != playerid) { format(string,sizeof(string),"Administrator \"%s\" has punsihed you", pName(playerid)); SendClientMessage(player1,blue,string); }
            SetPlayerPos(player1, 694.7562,-2377.2427,-0.0825);
        } else return SendClientMessage(playerid,RED,"ERROR: Player is not connected");
    } else return SendClientMessage(playerid,RED,"ERROR: You are not a high enough level to use this command");
}
Reply
#9

ohhhh sorry i didn't see you asked for strcmp command i was tiping and when i checked again forum i saw u asked for strcmp ok i'll try it after i go to eat OK?
Reply
#10

Ok, no worries cjgogo.

I fully appreciate your help aswell.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)