Pickups Dont Appear!
#1

My pickups dont appear ingame, here is my code:

Quote:

new LSPDenter;
new LSFBIenter;
new LSSWATenter;
new ASenter;
new CGenter;
new DMVenter;
new LSFDenter;
new GOVenter;
new LSCHenter;

Quote:

public OnGameModeInit()
{
LSPDenter = CreatePickup(1314,1,1553.4918,-1675.5505,16.1953,268.6017,-1);
LSFBIenter = CreatePickup(1314,1,1303.4347,-980.0889,38.3527,270.4826,-1);
LSSWATenter = CreatePickup(1314,1,1518.9583,-1453.4667,14.2069,173.7485,-1);
ASenter = CreatePickup(1314,1,1172.7777,-1323.3531,15.4008,88.2274,-1);
CGenter = CreatePickup(1314,1,2041.3705,-1409.6244,17.1641,1.5562, -1);
DMVenter = CreatePickup(1314,1,1219.1676,-1812.1008,16.5938,4.4373, -1);
LSFDenter = CreatePickup(1314,1,615.5232,-1542.0769,15.3336,82.7520, -1);
GOVenter = CreatePickup(1314,1,1154.1501,-1770.6067,16.5938,356.9626, -1);
LSCHenter = CreatePickup(1314,1,1480.7556,-1771.4180,18.7958,5.5127, -1);

Quote:

public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == LSPDenter)
{
GameTextForPlayer(playerid, "~w~Los Santos Police Department", 3000, 5);
return 1;
}
if(pickupid == LSFBIenter)
{
GameTextForPlayer(playerid, "~w~Federal Bureau of Investigation", 3000, 5);
return 1;
}
if(pickupid == LSSWATenter)
{
GameTextForPlayer(playerid, "~w~Special Weapons and Tactics", 3000, 5);
return 1;
}
if(pickupid == ASenter)
{
GameTextForPlayer(playerid, "~w~All Saints Hospital", 3000, 5);
return 1;
}
if(pickupid == CGenter)
{
GameTextForPlayer(playerid, "~w~County General Hospital", 3000, 5);
return 1;
}
if(pickupid == DMVenter)
{
GameTextForPlayer(playerid, "~w~Department of Motor Vehicles", 3000, 5);
return 1;
}
if(pickupid == GOVenter)
{
GameTextForPlayer(playerid, "~w~Government Offices", 3000, 5);
return 1;
}
if(pickupid == LSCHenter)
{
GameTextForPlayer(playerid, "~w~Los Santos City Hall", 3000, 5);
return 1;
}
if(pickupid == LSFDenter)
{
GameTextForPlayer(playerid, "~w~Los Santos Fire Department", 3000, 5);
return 1;
}

Reply
#2

Your linking all pickups to a virtual world. If your virtual world is not -1, you won't see them.

You have an extra parameter. Thanks fallout!
Код:
LSPDenter = CreatePickup(1314,1,1553.4918,-1675.5505,16.1953, -1);
LSFBIenter = CreatePickup(1314,1,1303.4347,-980.0889,38.3527, -1);
LSSWATenter = CreatePickup(1314,1,1518.9583,-1453.4667,14.2069, -1);
ASenter = CreatePickup(1314,1,1172.7777,-1323.3531,15.4008, -1);
CGenter = CreatePickup(1314,1,2041.3705,-1409.6244,17.1641, -1);
DMVenter = CreatePickup(1314,1,1219.1676,-1812.1008,16.5938, -1);
LSFDenter = CreatePickup(1314,1,615.5232,-1542.0769,15.3336, -1);
GOVenter = CreatePickup(1314,1,1154.1501,-1770.6067,16.5938, -1);
LSCHenter = CreatePickup(1314,1,1480.7556,-1771.4180,18.7958, -1);
CreatePickup Wiki link.
Reply
#3

CreatePickup doesn't need a rotation parameter.
You added 4 coordinates and you should only have three there.
Reply
#4

Quote:
Originally Posted by Psymetrix
Посмотреть сообщение
Your linking all pickups to a virtual world. If your virtual world is not -1, you won't see them.

Код:
LSPDenter = CreatePickup(1314,1,1553.4918,-1675.5505,16.1953,268.6017,0);
LSFBIenter = CreatePickup(1314,1,1303.4347,-980.0889,38.3527,270.4826,0);
LSSWATenter = CreatePickup(1314,1,1518.9583,-1453.4667,14.2069,173.7485,0);
ASenter = CreatePickup(1314,1,1172.7777,-1323.3531,15.4008,88.2274,0);
CGenter = CreatePickup(1314,1,2041.3705,-1409.6244,17.1641,1.5562, 0);
DMVenter = CreatePickup(1314,1,1219.1676,-1812.1008,16.5938,4.4373, 0);
LSFDenter = CreatePickup(1314,1,615.5232,-1542.0769,15.3336,82.7520, 0);
GOVenter = CreatePickup(1314,1,1154.1501,-1770.6067,16.5938,356.9626, 0);
LSCHenter = CreatePickup(1314,1,1480.7556,-1771.4180,18.7958,5.5127, 0);
CreatePickup Wiki link.
Indeed, but VirtualWorld -1 means 'show in every virtualworld' in this case.
I wonder why his compiler doesn't give an error with his extra parameter

Edit: oops :/ admin please merge my posts
Reply
#5

I'm pretty sure -1 is a valid virtual world.

I didn't notice the extra parameter. Ha.
Reply
#6

the wiki page sais that -1 means show in every virtual world
Ps: Check your pm
Reply
#7

Ah, Your right! I really should read things through, I tend to skim through it too quick.

While were on the subject of pickups, any idea why OnPlayerPickUpPickup is called every ~4 seconds while the player is standing on it?

PM's awesome! haha.
Reply
#8

Quote:
Originally Posted by Psymetrix
Посмотреть сообщение
Ah, Your right! I really should read things through, I tend to skim through it too quick.

While were on the subject of pickups, any idea why OnPlayerPickUpPickup is called every ~4 seconds while the player is standing on it?

PM's awesome! haha.
Sort of an anti-spam.
Reply
#9

But for every 4 seconds the player stands on a pickup, OnPlayerPickUpPickup is called.

Shouldn't it only be called as the player walks into the pickup?
Reply
#10

Arguable.
If you want to prevent that, set the type to 2. The pickup will disappear on pickup and re-spawn after a while (only for the player that picks it up - if you want it for all players you'd have to manually destroy it and re-create it on a timer).
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)