Disable teleport to player
#8

Okay, this is it.

pawn Код:
dcmd_tp(playerid,params[]) {
if (MinigameParticipant[playerid]==1)
{new Float:x, Float:y, Float:z;
  GetPlayerPos(playerid, x, y, z);
 CreateExplosion(x+random(5), y+random(5), z+random(5), 7, 10.0);
 SendClientMessage(playerid,red,"Do NEVER teleport out of minigames!!!! Thats annoying!!!");
}
    else
  {
  if(100000 < GetPlayerMoney(playerid)) {
      if(!strlen(params)) return SendClientMessage(playerid,red,"USAGE: /tp [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,"TP");
            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));
        GivePlayerMoney(playerid, -100000);
                SetVehicleVirtualWorld(GetPlayerVehicleID(playerid),GetPlayerVirtualWorld(player1));
            } else SetPlayerPos(playerid,x+2,y,z);
            GivePlayerMoney(playerid, -100000);
            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,"Sorry, you donґt have enaugh money to teleport. You need 100 000$ to teleport.");
    }
    return 1;}
How can i make it, that a player cannot teleport to a player whoґs in a minigame?
Reply


Messages In This Thread
Disable teleport to player - by Jeffry - 31.10.2009, 14:06
Re: Disable teleport to player - by DeathOnaStick - 31.10.2009, 14:25
Re: Disable teleport to player - by Striker_Moe - 31.10.2009, 14:27
Re: Disable teleport to player - by Jeffry - 31.10.2009, 14:32
Re: Disable teleport to player - by DeathOnaStick - 31.10.2009, 15:10
Re: Disable teleport to player - by Jeffry - 31.10.2009, 15:27
Re: Disable teleport to player - by DeathOnaStick - 31.10.2009, 15:28
Re: Disable teleport to player - by Jeffry - 31.10.2009, 15:28
Re: Disable teleport to player - by DeathOnaStick - 31.10.2009, 15:34
Re: Disable teleport to player - by Jeffry - 31.10.2009, 15:35

Forum Jump:


Users browsing this thread: 2 Guest(s)