im getting to old for this !!help needed!!
#1

Hello folks due to old age and fatigue i have forgotten things so now im stuck,i should no this but i just cant get it to work,so i thought i would see if you folks can lend me a hand here it is.

I have tried to make a tp blocker for admin,but only say for now lvl 5,but it does work but it also blocks the admin using it too for tele'ing to other players.

i will show you both parts of the code and see if you can see what the problem is cos damned if i can

Код:
CMD:tpblock(playerid,params[]) {
    if(PlayerInfo[playerid][Level] ==5) {
	    if(TeleportsBlocked[playerid] == 0){
	    TeleportsBlocked[playerid] = 1;
	    SendClientMessage(playerid, COLOR_RED, "You have blocked any player from teleporting to you.");
        return ;}
        else if (TeleportsBlocked[playerid] == 1){
        TeleportsBlocked[playerid] = 0;
        SendClientMessage(playerid, COLOR_ORANGE, "Players can now teleport to you.");
		return ;}}}
This turns it on or off
Код:
CMD:goto(playerid,params[]) {
    if(PlayerInfo[playerid][Level] >= 1 || IsPlayerAdmin(playerid)) {
        if(TeleportsBlocked[playerid] <= 5) return
	    SendClientMessage(playerid, red, "This admin has blocked players teleporting to him.");
	    if(isnull(params)) return SendClientMessage(playerid,red,"USAGE: /goto [playerid]");
	    new player1, string[128];
		if(!IsNumeric(params)) player1 = ReturnPlayerID(params);
	   	else player1 = strval(params);
	 	if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid) {
			CMDMessageToAdmins(playerid,"GOTO");
			new Float:x, Float:y, Float:z;	GetPlayerPos(player1,x,y,z); SetPlayerInterior(playerid,GetPlayerInterior(player1));
			SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(player1));
			if(GetPlayerState(playerid) == 2) {
				SetVehiclePos(GetPlayerVehicleID(playerid),x+3,y,z);	LinkVehicleToInterior(GetPlayerVehicleID(playerid),GetPlayerInterior(player1));
				SetVehicleVirtualWorld(GetPlayerVehicleID(playerid),GetPlayerVirtualWorld(player1));
			} else SetPlayerPos(playerid,x+2,y,z);
			format(string,sizeof(string),"You have teleported to \"%s\"", pName(player1));
			return SendClientMessage(playerid,blue,string);
		} else return SendClientMessage(playerid, red, "Player is not connected or is yourself");
	} else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");}
Im thinking i have put something in the wrong place,but im not sure
cheers for anyhelp in advanced.as im away working for a few days again,so wont be on-line
Reply
#2

try
Quote:

if(AccInfo[playerid][Level] >= 5 || IsPlayerAdmin(playerid))

i think its like that im not sure with admin cmds n that
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)