Mixed pickups?
#1

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

pawn Код:
#prisonInt;
#prisonOut;
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..
Reply
#2

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;
}
Reply
#3

Nice thanks!, what was wrong??..
Reply
#4

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
Reply
#5

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!.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)