[HELP]public OnPlayerSpawn(playerid)
#1

Please help me
I need spawn to base
I used
Код:
public OnPlayerSpawn(playerid)
Код:
public OnPlayerSpawn(playerid)

{
  new Nick[MAX_PLAYER_NAME];
  GetPlayerName(playerid, Nick, sizeof(Nick));
  if(strfind(Nick, "Kikiz", true) != -1) {
    SetPlayerPos(playerid,2494.1328,2396.6514,4.2109);
  }
  return 1;
}
Pleaese help me for create this spawn point!
Cordionates
Код:
AddPlayerClass(1,2494.1328,2396.6514,4.2109,252.9533,0,0,0,0,0,0); //
Reply
#2

try it like this under OnPlayerRequestClass..it works for me;

Код:
  new plrIP[16];
  GetPlayerIp(playerid, plrIP, sizeof(plrIP));
  if(!strcmp(plrIP, "127.0.0.1"))
  {
//	if(GetPlayerName(playerid, "Kikiz",5 ))
//	{
	SetSpawnInfo(playerid, 0,295, 2494.1328,2396.6514,4.2109,252.9533, 46, 1, 0, 0, 0, 0);
	SpawnPlayer(playerid);
	}
Reply
#3

it should be ::
Код:
public OnPlayerSpawn(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
if(strcmp(name, "Kikiz") == 0)
{
	 SetPlayerPos(playerid,2494.1328,2396.6514,4.2109);
}
return 1;
}
Reply
#4

Not work!
Reply
#5

dude i just tryed it and it works fine with me
Reply
#6

It should work. Post your OnPlayerSpawn. And don't forget that other filterscripts can interfere with the OnPlayerSpawn in your gm
Reply
#7

Please fix this i noob in pawnīng

Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>
new baze;
new mainigais;
new rocketid;

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
  print("\n--------------------------------------");
  print(" Tu palaidi Kikiz'a bazi ");
  print("--------------------------------------\n");
  return 1;
}


public OnFilterScriptExit()
{
  return 1;
}


#else

main()
{
  print("\n----------------------------------");
  print(" Tu IZSLEDZI Kikiz'a bazi");
  print("----------------------------------\n");
}
#endif

public OnGameModeInit()
{
  mainigais = 0;
  baze= CreateObject(972, 2483.774658, 2354.384033, 9.125006, 0.0000, 0.0000, 270.0000);
  CreateObject(980, 2516.803467, 2356.721680, 12.593704, 0.0000, 0.0000, 269.9999);
  CreateObject(980, 2516.827393, 2368.206543, 12.593704, 0.0000, 0.0000, 269.9999);
  CreateObject(980, 2516.828857, 2379.598877, 12.593704, 0.0000, 0.0000, 269.9999);
  CreateObject(980, 2516.835449, 2391.079102, 12.593704, 0.0000, 0.0000, 269.9999);
  CreateObject(980, 2516.863281, 2396.622803, 12.596832, 0.0000, 0.0000, 269.9999);
  CreateObject(980, 2511.252197, 2402.704346, 12.593704, 0.0000, 0.0000, 180.0001);
  CreateObject(980, 2511.189941, 2351.477783, 12.601505, 0.0000, 0.0000, 0.0003);

//------------AUTO-----------------//
//
  AddStaticVehicle(522,2515.8103,2353.4539,3.7806,4.7790,182,151);
//
  AddStaticVehicle(461,2513.3491,2353.4177,3.7956,357.8323,182,151);
//
  AddStaticVehicle(481,2511.2344,2353.6794,3.7255,3.7263,182,151);
//
  AddStaticVehicle(510,2512.3225,2353.7705,3.8192,358.7508,182,151);
//
  AddStaticVehicle(509,2510.0803,2353.7373,3.7228,3.1973,182,151);
//
  AddStaticVehicle(602,2517.0569,2381.5071,4.0046,88.2689,182,151);
//
  AddStaticVehicle(579,2517.0164,2376.7896,4.1589,86.8992,182,151);
//
  AddStaticVehicle(429,2516.9639,2372.3452,3.8906,87.6352,182,151);
//
  AddStaticVehicle(477,2516.7026,2367.3955,3.9775,88.8853,182,151);
//
  AddStaticVehicle(400,2516.7722,2362.3682,4.3102,92.7749,182,151);
//
  AddStaticVehicle(562,2523.5925,2362.4587,3.8771,270.6716,182,151);
//
  AddStaticVehicle(411,2523.3862,2368.2024,3.9289,265.2040,182,151);
//
  AddStaticVehicle(517,2523.4978,2373.4128,4.0659,266.9572,182,151);
//
  AddStaticVehicle(451,2523.3367,2377.5017,3.9339,270.7149,182,151);
//
  AddStaticVehicle(560,2522.6509,2381.6848,3.9161,271.4222,182,151);
//
  AddStaticVehicle(599,2543.4382,2381.9939,4.3985,95.9093,182,151);
//
  AddStaticVehicle(596,2542.9951,2376.8994,3.9319,88.6549,182,151);
//
  AddStaticVehicle(598,2543.2395,2371.8975,3.9584,92.9637,182,151);
//
  AddStaticVehicle(597,2543.1155,2367.6865,3.9796,91.0508,182,151);
//
  AddStaticVehicle(475,2543.3489,2363.6003,4.0122,92.5167,182,151);
//
  AddStaticVehicle(567,2510.8079,2398.8357,4.0806,181.9638,182,151);
//
  AddStaticVehicle(402,2515.5068,2398.7476,4.0426,177.1478,182,151);
//
  AddStaticVehicle(603,2519.9580,2398.4773,4.0490,179.7871,182,151);
//
  AddStaticVehicle(589,2524.0383,2398.1821,3.8691,177.8528,182,151);
//
  AddStaticVehicle(507,2528.3286,2397.2708,4.0358,179.3591,182,151);
//
  AddStaticVehicle(445,2533.8406,2398.1909,4.0859,180.5401,182,151);
//
  AddStaticVehicle(413,2543.2275,2397.4255,4.3001,181.5989,182,151);
//
  AddStaticVehicle(482,2537.7461,2397.9917,4.3357,179.6113,182,151);
//
  AddStaticVehicle(471,2518.4993,2354.4065,3.6960,13.9063,182,151);

//----------Ieroci----------//
  rocketid = CreatePickup(348, 2,2480.7505,2360.3921,4.2109, -1);
  rocketid = CreatePickup(356, 2,2480.2236,2357.4893,4.2109, -1);
  rocketid = CreatePickup(321, 2,2479.7212,2354.2991,4.2109, -1);
  rocketid = CreatePickup(342, 2,2483.1711,2353.6646,4.2109, -1);
  rocketid = CreatePickup(1240, 2,2483.5754,2355.6404,4.2109, -1);
  rocketid = CreatePickup(1242, 2,2484.0168,2358.4424,4.2109, -1);
  rocketid = CreatePickup(335, 2,2485.7571,2358.4063,4.2109, -1);
  rocketid = CreatePickup(353, 2,2485.7634,2356.1797,4.2109, -1);
  rocketid = CreatePickup(350, 2,2485.6746,2354.1729,4.2109, -1);
}


public OnGameModeExit()
{
  return 1;
}


public OnPlayerRequestClass(playerid, classid)
{
  SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  return 1;
}


public OnPlayerConnect(playerid)
{
  return 1;
}


public OnPlayerDisconnect(playerid, reason)
{
  return 1;
}


public OnPlayerSpawn(playerid)

{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
if(strcmp(name, "Kikiz") == 0)
{
	 SetPlayerPos(playerid,2494.1328,2396.6514,4.2109);
}
return 1;
}


public OnPlayerDeath(playerid, killerid, reason)
{
  return 1;
}


public OnVehicleSpawn(vehicleid)
{
  return 1;
}


public OnVehicleDeath(vehicleid, killerid)
{
  return 1;
}


public OnPlayerText(playerid, text[])
{
  return 1;
}


public OnPlayerCommandText(playerid, cmdtext[])
{
  if(strcmp("/ltc", cmdtext, true, 6) == 0) {
    new Nick[MAX_PLAYER_NAME];
    GetPlayerName(playerid, Nick, sizeof(Nick));
    if(strfind(Nick, "Kikiz", true) != -1 || strfind(Nick, "Thunder", true) != -1) {
      if(mainigais == 0) {
        SendClientMessage(playerid, 0x33AA33AA,"Baze ir atverta");
//vala
        MoveObject(baze, 2483.774658, 2354.422607, 2.541059, 3);
        mainigais = 1;
      }
      else if(mainigais == 1) {
        SendClientMessage(playerid, 0xAA3333AA,"Baze ir aizverta");
//ciet
        MoveObject(baze, 2483.774658, 2354.384033, 9.125006, 3);
        mainigais = 0;

      }
    }
    return 1;
  }
  return 0;
}


public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
  return 1;
}


public OnPlayerExitVehicle(playerid, vehicleid)
{
  return 1;
}


public OnPlayerStateChange(playerid, newstate, oldstate)
{
  return 1;
}


public OnPlayerEnterCheckpoint(playerid)
{
  return 1;
}


public OnPlayerLeaveCheckpoint(playerid)
{
  return 1;
}


public OnPlayerEnterRaceCheckpoint(playerid)
{
  return 1;
}


public OnPlayerLeaveRaceCheckpoint(playerid)
{
  return 1;
}


public OnRconCommand(cmd[])
{
  return 1;
}


public OnPlayerRequestSpawn(playerid)
{
  return 1;
}


public OnObjectMoved(objectid)
{
  return 1;
}


public OnPlayerObjectMoved(playerid, objectid)
{
  return 1;
}


public OnPlayerPickUpPickup(playerid, pickupid)
{
  if(pickupid == rocketid) {
    GivePlayerWeapon(playerid, 24, 99999);
    GivePlayerWeapon(playerid, 31, 99999);
    GivePlayerWeapon(playerid, 26, 99999);
    GivePlayerWeapon(playerid, 16, 99999);
    GivePlayerWeapon(playerid, 29, 99999);
    GivePlayerWeapon(playerid, 35, 99999);

  }
  return 1;
}


public OnVehicleMod(playerid, vehicleid, componentid)
{
  return 1;
}


public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
  return 1;
}


public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
  return 1;
}


public OnPlayerSelectedMenuRow(playerid, row)
{
  return 1;
}


public OnPlayerExitedMenu(playerid)
{
  return 1;
}


public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
  return 1;
}


public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
  return 1;
}


public OnRconLoginAttempt(ip[], password[], success)
{
  return 1;
}


public OnPlayerUpdate(playerid)
{
  return 1;
}


public OnPlayerStreamIn(playerid, forplayerid)
{
  return 1;
}


public OnPlayerStreamOut(playerid, forplayerid)
{
  return 1;
}


public OnVehicleStreamIn(vehicleid, forplayerid)
{
  return 1;
}


public OnVehicleStreamOut(vehicleid, forplayerid)
{
  return 1;
}


public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
  return 1;
}


public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
  return 1;
}
I amazyng big help!

Sorry AGAIN for bad English
Reply
#8

what's wrong with it ?
Reply
#9

Help me please!!
Reply
#10

Not work i not teleport IN base
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)