onplayerpickuppickup
#1


I have some pickups I made and it works completely perfect on my test server (windows xp) and when i load the GM to the host (linux) the icon is there but it does not have any function. (does not do anything)

[/code]
//AddStaticPickup(1239,2,-1969.5936,290.6212,35.1719); // autoban i
AddStaticPickup(355,2,-2651.7878,1412.5660,906.2734); // ak47 in admin hq
AddStaticPickup(1240,2,-2651.9155,1410.3878,906.2734); // health in admin hq
AddStaticPickup(353,2,-2651.8179,1408.0308,906.2734); // mp5 in admin hq
/* AddStaticPickup(1247,2,-1656.6625,787.9991,18.1377); // SF bribe
AddStaticPickup(1247,2,-2128.1238,-43.4016,35.3203); // SF bribe
AddStaticPickup(1247,2,-2656.3020,-134.5093,4.0135); // SF bribe
AddStaticPickup(1247,2,-2561.5791,1215.8872,41.2109); // SF bribe
AddStaticPickup(1247,2,-1764.5795,1302.2582,64.4107); // SF bribe
AddStaticPickup(1247,2,-1765.2048,1302.2125,66.3110); // SF bribe
AddStaticPickup(1247,2,-1753.3229,885.2010,295.8750); // SF bribe
*/ AddStaticPickup(1239,2,4039.0156,844.8253,22.1710) ; //keymaker info icon 4
AddStaticPickup(1239,2,4038.8174,836.9286,22.1639) ; //keymaker info icon 5
AddStaticPickup(1239,2,4039.1311,829.0085,22.1639) ; //keymaker info icon 6
AddStaticPickup(1239,2,4035.2263,825.2151,22.1639) ; //keymaker info icon 7
AddStaticPickup(1239,2,4024.0303,808.4360,22.1639) ; //keymaker info icon 8
AddStaticPickup(1239,2,4031.2373,808.5248,22.1710) ; //keymaker info icon 9
AddStaticPickup(1239,2,4024.1450,834.3604,22.1639) ; //keymaker info icon 10
AddStaticPickup(1239,2,-794.8670,490.1471,1376.1953); // deleted info icon 11


-----onplayerpickuppickup----------

if(pickupid == 5) {
SendClientMessage(playerid, COLOR_YELLOW, "This door will let you in liberty city if you have keys");
SendClientMessage(playerid, COLOR_YELLOW, "Type /lc to get in this door -- ** CLOSED UNTIL SAMP 0.3**");
return 1;
}

if(pickupid == 6) {
SendClientMessage(playerid, COLOR_YELLOW, "This door will let you in ammunation shooting range if you have keys");
SendClientMessage(playerid, COLOR_YELLOW, "Type /ammu2 to get in this door");
return 1;
}

if(pickupid == 7) {
SendClientMessage(playerid, COLOR_YELLOW, "This door will let you in EAST SF if you have keys");
SendClientMessage(playerid, COLOR_YELLOW, "Type /eastsf to get in this door");
return 1;
}

if(pickupid == {
SendClientMessage(playerid, COLOR_YELLOW, "This door will let you in WEST SF if you have keys");
SendClientMessage(playerid, COLOR_YELLOW, "Type /westsf to get in this door");
return 1;
}

if(pickupid == 9) {
SendClientMessage(playerid, COLOR_YELLOW, "This door will let you in NORTH LV if you have keys");
SendClientMessage(playerid, COLOR_YELLOW, "Type /northlv to get in this door");
return 1;
}


if(pickupid == 10) {
SendClientMessage(playerid, COLOR_YELLOW, "This door will let you in SOUTHLS if you have keys");
SendClientMessage(playerid, COLOR_YELLOW, "Type /southls to get in this door");
return 1;
}
/*
if(pickupid == 11) {
SendClientMessage(playerid, COLOR_YELLOW, "This door will let you in liberty city if you have keys");
SendClientMessage(playerid, COLOR_YELLOW, "** CLOSED UNTIL SAMP 0.3**");
return 1;
}
*/
if(pickupid == 11) {
SendClientMessage(playerid,COLOR_YELLOW,"Deletion Area:");
SendClientMessage(playerid,COLOR_YELLOW,"You can return to the source or attempt to re-enter the Matrix");
SendClientMessage(playerid,COLOR_YELLOW,"Type /source to go to the source (Recommended by the Matrix MainFrame)");
SendClientMessage(playerid,COLOR_YELLOW,"Or type /disobey to attempt to avoid deletion and try to re-enter the Matrix");
SendClientMessage(playerid,COLOR_YELLOW,"If you type /disobey there is a chance it will fail and you will be re-deleted");
InDelArea[playerid] =1;
return 1;
}

[code]
Reply
#2

Use CreatePickup.

Reply
#3


Any reason why it works flawless on my test server thats running the same exact gm...
Reply
#4

Look. You need to add
Code:
new pickup;
or whatever you're calling it at the top of your script.

Than.
Code:
public OnGameModeInit()
{
     CreatePickup(pickup, 2, X, Y, Z);
	return 1;
}
CreatePickup(HERE, 2, X, Y , Z); That's where the name of it is placed from new pickup; at the top.

Code:
public OnPlayerPickUpPickup(playerid, pickupid)
{
	if (pickupid == pickup)
	{
	    // Here add whatever the effect to be.
	}
    return 1;
}
If you want another pickup, change
Code:
if (pickupid == pickup)
	{
	    // Here add whatever the effect to be.
	}
to
Code:
else if (pickupid == pickup)
	{
	    // Here add whatever the effect to be.
	}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)