help at object teleport
#1

PHP код:
new pickup1;
new 
pickup2
PHP код:
pickup1 CreatePickup(1318192763.7703,1269.7902,10.7500);
pickup2 CreatePickup(1318191437.1281,-1062.7485,213.3828); 
PHP код:
public OnPlayerPickUpPickup(playeridpickupid)
{
   if(
pickupid == pickup1)
    {
   
SetPlayerPos(playerid1444.4569,-1070.2080,213.3828);
   
SendClientMessage(playerid0xFFFF00FF"You have been teleported to the party!");
   if(
pickupid == pickup2)
   
SetPlayerPos(playerid, -1299.0413,-291.0421,14.1484);
   
SendClientMessage(playerid0xFFFF00FF"Welcome to the San Fiero Airport!");
   return 
1;
    }
   return 
0;

Everything works fine, pickup 1 works good, when i enter pickup 1 i teleport and it says SendClientMessage for both pickups, and when i enter pickup 2 it dissapears nothing happends, pls help
Reply
#2

You're checking if the player picked up the second pickup when the player is picking up the first pickup but not checking if the second pickup was picked up if the first pickup wasn't picked up.

pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
      if(pickupid == pickup1)
     {
             SetPlayerPos(playerid, 1444.4569,-1070.2080,213.3828);
             SendClientMessage(playerid, 0xFFFF00FF, "You have been teleported to the party!");
     } // close the bracket.
     if(pickupid == pickup2)
     {
            SetPlayerPos(playerid, -1299.0413,-291.0421,14.1484);
            SendClientMessage(playerid, 0xFFFF00FF, "Welcome to the San Fiero Airport!");
     }
     return 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)