Need help on two things.
#1

I have this code that sends the player to a punishment house far out to sea and I want to make it so when the player gets teleported his admin level gets demoted to 0 and he cannot use commands.

Here is what I have so far.

I have this defined at the top of my filterscript.

pawn Код:
#define dcmd(%1,%2,%3) if(!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
I then have this under OnPlayerCommandText.

pawn Код:
dcmd(housepun,8,cmdtext);
I then have this at the very bottom of my script.

pawn Код:
dcmd_housepun(playerid,params[])
{
    if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid,COLOR_RED,"ERROR: You are not a high enough level to use this command");
    if(!strlen(params)) return SendClientMessage(playerid, COLOR_PINK, "USAGE: /housepun [playerid]");
    new player1 = strval(params), string[128], pName[24];
    if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID)
    {
        GetPlayerName(playerid, pName, 24);

        format(string, sizeof(string), "You have punished \"%s\" ", pName);
        SendClientMessage(playerid,COLOR_PINK,string);
        if(player1 != playerid)
        {
            format(string,sizeof(string),"Administrator \"%s\" has punished you", pName);
            SendClientMessage(player1,COLOR_PINK,string);
        }
        SetPlayerPos(player1, 694.7562,-2377.2427,-0.0825);
    }
    if(!IsPlayerConnected(player1) || player1 == INVALID_PLAYER_ID ) return SendClientMessage(playerid,COLOR_RED,"ERROR: Player is not connected");
    return 1;
}
This works perfectly, it teleports the player to were I want them to go and it gives them the client message. But I want it to make the player that IS getting teleported to the housepun (my punishment) to get demoted to admin level 0 and not been able to use commands.

I am using Ladmin for my admin script.

Thanks.
Reply


Messages In This Thread
Need help on two things. - by captainjohn - 24.04.2011, 12:24
Re: Need help on two things. - by dannyk0ed - 24.04.2011, 12:31
Re: Need help on two things. - by Sinner - 24.04.2011, 12:36
Re: Need help on two things. - by Sascha - 24.04.2011, 12:36
Re: Need help on two things. - by captainjohn - 24.04.2011, 12:52
Re: Need help on two things. - by captainjohn - 24.04.2011, 14:23
Re: Need help on two things. - by grand.Theft.Otto - 24.04.2011, 16:02
Re: Need help on two things. - by captainjohn - 24.04.2011, 16:10
Re: Need help on two things. - by grand.Theft.Otto - 24.04.2011, 16:17
Re: Need help on two things. - by captainjohn - 24.04.2011, 16:20

Forum Jump:


Users browsing this thread: 1 Guest(s)