Need help with Teleport
#1

Hi I am trying to add a Teleporter that if you Right on the map you Teleport there. And i have it in and it dose not woork for me. Here is my OnPlayerConnect
pawn Код:
public OnPlayerConnect(playerid)
{
  GameTextForPlayer(playerid,"~w~]Island: ~r~Reykjavik]",5000,5);
  SendPlayerFormattedText(playerid, "Velkomin til Reykjavнkur, Fyrir Hjalp skrifiр /hjalpin.", 0);
  SendPlayerFormattedText(playerid, "Til aр nэskrб ykkur geriр /nyskra [lykilorр]", 0);
  SendPlayerFormattedText(playerid, "Til aр Innskrб ykkur geriр юб /innskra [lykilorр], geriр/reglur til aр sjб Reglur.", 0);
  SendPlayerFormattedText(playerid, "Hйr eru allir vinir og eru ekki meр neinn уsуma. Юъ ert aр spila б нslandi н Reykjavнk", 0);
  gActivePlayers[playerid]++;
  gLastGaveCash[playerid] = GetTickCount();

  TextDrawShowForPlayer(playerid, Textdraw0);
  TextDrawShowForPlayer(playerid, Textdraw1);
  TextDrawShowForPlayer(playerid, Textdraw3);
  TextDrawShowForPlayer(playerid, Textdraw5);
  TextDrawShowForPlayer(playerid, Textdraw2);
  TextDrawShowForPlayer(playerid, Textdraw4);
  TextDrawShowForPlayer(playerid, Textdraw6);

  new pName[MAX_PLAYER_NAME];
  new string[48];
  GetPlayerName(playerid, pName, sizeof(pName));
  format(string, sizeof(string), "%s Hefur komiр inn.", pName);
  SendClientMessageToAll(0xAAAAAAAA, string);
  AllowPlayerTeleport( playerid, 1 );

  return 1;
}
Any idear wuy this dose not woork?
Reply
#2

There's anything about changing the player posinion..
Reply
#3

when you say right on the map do you meen like
pawn Код:
AllowPlayerTeleport(playerid, true);
Reply
#4

I mean like when you Right Click on the Map and place the cirle then you teleport there.
Reply
#5

ah ok then add
pawn Код:
AllowPlayerTeleport(playerid, true);
under ongamemodeinit and then players will be able to teleport by right clicking on the map
Reply
#6

ok i try to add it under public OnGameModeInit() i get this error
pawn Код:
R:\gamemodes\djdanni.pwn(824) : error 017: undefined symbol "playerid"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
And here is my public OnGameModeInit() can you mabe show me if this is not Right?
pawn Код:
public OnGameModeInit()
{
    SetGameModeText("Island");

    ShowPlayerMarkers(1);
    ShowNameTags(1);
    AllowPlayerTeleport( playerid, true );
    Textdraw0 = TextDrawCreate(279.000000,426.000000,"Islenski GTA SA Serverinn");
    Textdraw1 = TextDrawCreate(3.000000,436.000000,"[url]http://www.gtasa.is"[/url]);
    TextDrawAlignment(Textdraw0,0);
    TextDrawAlignment(Textdraw1,0);
    TextDrawBackgroundColor(Textdraw0,0x000000ff);
    TextDrawBackgroundColor(Textdraw1,0x00ff0033);
    TextDrawFont(Textdraw0,2);
    TextDrawLetterSize(Textdraw0,0.599999,2.000000);
    TextDrawFont(Textdraw1,2);
    TextDrawLetterSize(Textdraw1,0.399999,1.000000);
    TextDrawColor(Textdraw0,0x00ff00ff);
    TextDrawColor(Textdraw1,0x0000ffff);
    TextDrawSetOutline(Textdraw0,1);
    TextDrawSetOutline(Textdraw1,1);
    TextDrawSetProportional(Textdraw0,1);
    TextDrawSetProportional(Textdraw1,1);
    TextDrawSetShadow(Textdraw0,1);
    TextDrawSetShadow(Textdraw1,1);
    Textdraw3 = TextDrawCreate(4.000000,420.000000,"Fyrir Reglur gerid /reglur");
    TextDrawAlignment(Textdraw3,0);
    TextDrawBackgroundColor(Textdraw3,0xffff0066);
    TextDrawFont(Textdraw3,2);
    TextDrawLetterSize(Textdraw3,0.300000,1.799999);
    TextDrawColor(Textdraw3,0xff0000ff);
    TextDrawSetOutline(Textdraw3,1);
    TextDrawSetProportional(Textdraw3,1);
    TextDrawSetShadow(Textdraw3,1);
    Textdraw5 = TextDrawCreate(4.000000,420.000000,"Fyrir Reglur gerid /reglur");
    Textdraw2 = TextDrawCreate(136.000000,392.000000,"Fyrir Hjalp gerid /hjalpin");
    Textdraw4 = TextDrawCreate(127.000000,405.000000,"laga og snua bil gerid /fix og /flip");
    Textdraw6 = TextDrawCreate(141.000000,379.000000,"Til ad laesa bil /lock til ad aflaesa /unlock");
    TextDrawAlignment(Textdraw5,0);
    TextDrawAlignment(Textdraw2,0);
    TextDrawAlignment(Textdraw4,0);
    TextDrawAlignment(Textdraw6,0);
    TextDrawBackgroundColor(Textdraw5,0xffff0066);
    TextDrawBackgroundColor(Textdraw2,0xff000066);
    TextDrawBackgroundColor(Textdraw4,0xffffff66);
    TextDrawBackgroundColor(Textdraw6,0xff0000ff);
    TextDrawFont(Textdraw5,2);
    TextDrawLetterSize(Textdraw5,0.300000,1.799999);
    TextDrawFont(Textdraw2,2);
    TextDrawLetterSize(Textdraw2,0.399999,1.799999);
    TextDrawFont(Textdraw4,2);
    TextDrawLetterSize(Textdraw4,0.399999,2.000000);
    TextDrawFont(Textdraw6,2);
    TextDrawLetterSize(Textdraw6,0.299999,1.500000);
    TextDrawColor(Textdraw5,0xff0000ff);
    TextDrawColor(Textdraw2,0xffff00ff);
    TextDrawColor(Textdraw4,0x000000ff);
    TextDrawColor(Textdraw6,0xffffffff);
    TextDrawSetOutline(Textdraw5,1);
    TextDrawSetOutline(Textdraw2,1);
    TextDrawSetOutline(Textdraw4,1);
    TextDrawSetOutline(Textdraw6,1);
    TextDrawSetProportional(Textdraw5,1);
    TextDrawSetProportional(Textdraw2,1);
    TextDrawSetProportional(Textdraw4,1);
    TextDrawSetProportional(Textdraw6,1);
    TextDrawSetShadow(Textdraw5,1);
    TextDrawSetShadow(Textdraw2,1);
    TextDrawSetShadow(Textdraw4,1);
    TextDrawSetShadow(Textdraw6,1);

  vehicle1 = CreateVehicle(411,1975.1608,2410.6865,10.5284,0.0000,0,0, 500); //
    vehicle2 = CreateVehicle(451,1979.8284,2410.9998,10.5199,0.1600,0,0, 500); //
    vehicle3 = CreateVehicle(541,1985.3804,2410.8665,10.4692,359.8416,0,0, 500); //
    vehicle4 = CreateVehicle(506,1991.0129,2411.3164,10.5248,0.4955,0,0, 500); //
    vehicle5 = CreateVehicle(415,1994.4431,2410.6619,10.5774,357.6273,0,0, 500); //
    vehicle6 = CreateVehicle(429,1997.7251,2411.1165,10.5099,1.1507,0,0, 500); //
    vehicle7 = CreateVehicle(559,2002.1320,2411.3860,10.4818,359.9039,0,0, 500); //
    vehicle8 = CreateVehicle(562,2006.6968,2411.0032,10.5031,1.6535,0,0, 500); //
    vehicle9 = CreateVehicle(560,2010.8726,2411.0291,10.5274,1.6744,158,158, 500); //
Reply
#7

Somone?
Reply
#8

yes, the variable playerid is never defined..

pawn Код:
AllowPlayerTeleport( playerid, true );
remove that, put it under OnPlayerConnect(playerid), also.. that function is bugged at the moment and won't work
Reply
#9

ok sorry my fault put
pawn Код:
AllowPlayerTeleport(playerid, true);
under onplayerspawn or connect
Reply
#10

ok here is my OnPlayerSpawn
pawn Код:
public OnPlayerSpawn(playerid)
{
    SetPlayerArmour(playerid, 100);
    GivePlayerMoney(playerid, PocketMoney);
    SetPlayerInterior(playerid,0);
    SetPlayerRandomSpawn(playerid);
    AllowPlayerTeleport(playerid, true);
    return 1;
}
But still dose not woork
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)