Disable teleport to player
#1

Okay guys, i made a minigame in my script, and it works fine. Also i disabled that people can teleport OUT of a minigame.
My question is: How can i make it, that people canґt teleport INTO the minigame.

Here are the scripts of the minigame and the punishment when try to teleport out.

This is the minigame
pawn Код:
if (strcmp("/rocket", cmdtext, true) == 0)
{
MinigameParticipant[playerid]=1;  // let the system know that heґs in minigame
  ResetPlayerWeapons(playerid);
  SetPlayerHealth(playerid, 100);
    SetPlayerArmour(playerid,100);
    SendClientMessageToAll(0x828282FF, "Server: A player has joined the Rocket-Ramba-Zamba. Type /rocket  to join as well!");
    SendClientMessage(playerid, 0x007F00FF, "Have fun.");
    SetPlayerPos(playerid, -1396.8975,1249.1334,1039.8672);
    SetPlayerFacingAngle(playerid, 0);
 SetPlayerInterior(playerid, 16);
    SaveToFile("RocketLog",string);
    GivePlayerWeapon(playerid,35,10000);
    return 1;
}
System knows now:
pawn Код:
MinigameParticipant[playerid]=1;  // let the system know that heґs in minigame
So it gives punishment when try to teleport:

pawn Код:
if(strcmp("/taxi 0", cmdtext, true) == 0)

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!!!");
 return 1;

(...)(my taxi location and some cash things...)
So now you know all i wrote. How can i make it now, that i cannot teleport TO a player who is IN a minigame.


I hope you understand what i mean.
Jeffry
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: 4 Guest(s)