Mixed pickups? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Mixed pickups? (
/showthread.php?tid=353572)
Mixed pickups? -
davve95 - 23.06.2012
Hi!
I created one more pickup now (have 2 now) But when I enter the first pickup
I just teleport to a place that should be for the second pickup :S... They are mixed some how.
Here is the codes:
Defines
The pickups
pawn Код:
CreatePickup(1318, 1, -2624.9873,1411.7520,7.0938, -1); //For pickup to prison
CreatePickup(1318, 1, -5158.9604,2863.5662,32.1891 -1);//Prison door to go out (pickup) //prisonOut
OnPlayerPickupPickup
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == prisonInt) {
SetPlayerPos(playerid,-5159.8765,2867.2976,32.1891);
}
if(pickupid == prisonOut) {
SetPlayerPos(playerid,-2623.3435,1412.0813,7.0938);
}
return 1;
}
Thanks alot for reply!/help..
Re: Mixed pickups? -
SnG.Scot_MisCuDI - 23.06.2012
pawn Код:
new prisonInt;
new prisonOut;
pawn Код:
prisonInt = CreatePickup(1318, 1, -2624.9873,1411.7520,7.0938, -1); //For pickup to prison
prisonOut = CreatePickup(1318, 1, -5158.9604,2863.5662,32.1891 -1);//Prison door to go out (pickup) //prisonOut
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == prisonInt) {
SetPlayerPos(playerid,-5159.8765,2867.2976,32.1891);
}
else if(pickupid == prisonOut) {
SetPlayerPos(playerid,-2623.3435,1412.0813,7.0938);
}
return 1;
}
Re: Mixed pickups? -
davve95 - 23.06.2012
Nice thanks!, what was wrong??..
Re: Mixed pickups? -
Ironboy - 23.06.2012
Quote:
Originally Posted by davve95
Nice thanks!, what was wrong??..
|
It is because you have just added the pickup without prisonInt & prisonOut in OnGameModeInit callback
It should be like this
pawn Код:
prisonInt = CreatePickup(1318, 1, -2624.9873,1411.7520,7.0938, -1); //For pickup to prison
prisonOut = CreatePickup(1318, 1, -5158.9604,2863.5662,32.1891 -1);//Prison door to go out (pickup) //prisonOut
Re: Mixed pickups? -
davve95 - 24.06.2012
Quote:
Originally Posted by Ironboy
It is because you have just added the pickup without prisonInt & prisonOut in OnGameModeInit callback
It should be like this
pawn Код:
prisonInt = CreatePickup(1318, 1, -2624.9873,1411.7520,7.0938, -1); //For pickup to prison prisonOut = CreatePickup(1318, 1, -5158.9604,2863.5662,32.1891 -1);//Prison door to go out (pickup) //prisonOut
|
Oh ok I see. Thanks alot guys!.