OnPlayerPickupPickup problems..
#1

On the top of the script:

pawn Код:
new
    //Removed the rest of the new's to save post-space..
    PickupTimer1[MAX_PLAYERS],
    PickupTimer2[MAX_PLAYERS],
    PickupTimer3[MAX_PLAYERS],
    THCDE,
    THCM4,
    THCSPA
    //THCAR
;
OnGameModeInit:

pawn Код:
THCDE = AddStaticPickup(348, 3, 1406.7626,6.7967,1000.9209, 0);
    THCSPA = AddStaticPickup(351, 3, 1403.6320,6.8458,1000.9063, 0);
    THCM4 = AddStaticPickup(356, 3, 1400.4009,6.8681,1000.9063, 0);
    AddStaticPickup(1242, 3, 1389.4666,5.8593,1001.9375, 0); //THCAR
OnPlayerPickupPickup:

pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(IsPlayerInRangeOfPoint(playerid, 1, 2036.493286, -1404.380004, 17.260807)) //This works aswell, but that's about it.
    {
        GameTextForPlayer(playerid, "~r~/heal", 1000, 1);
    }
    if(pickupid == THCSPA) { //This is the only one that seems to work.
        if(PickupTimer2[playerid] == 0) {
            GivePlayerWeapon(playerid, 27, 350);
            PickupTimer2[playerid] = 1;
        }
    }
    else if(pickupid == THCM4) {
        if(PickupTimer3[playerid] == 0) {
            GivePlayerWeapon(playerid, 31, 500);
            PickupTimer3[playerid] = 1;
        }
    }
    else if(pickupid == THCDE) {
        if(PickupTimer1[playerid] == 0) {
            GivePlayerWeapon(playerid, 24, 350);
            PickupTimer1[playerid] = 1;
        }
    }
    /*else if(IsPlayerInRangeOfPoint(playerid, 3, 1406.7626,6.7967,1000.9209))
    {
        if(PickupTimer1[playerid] == 0) {
            GivePlayerWeapon(playerid, 24, 350);
            PickupTimer1[playerid] = 1;
        }
    }
    else if(IsPlayerInRangeOfPoint(playerid, 3, 1400.4009,6.8681,1000.9063))
    {
        if(PickupTimer2[playerid] == 0) {
            GivePlayerWeapon(playerid, 27, 350);
            PickupTimer2[playerid] = 1;
        }
    }
    else if(IsPlayerInRangeOfPoint(playerid, 3, 1403.6320,6.8458,1000.9063))
    {
        if(PickupTimer3[playerid] == 0) {
            GivePlayerWeapon(playerid, 31, 500);
            PickupTimer3[playerid] = 1;
        }
    }*/

    return 1;
}
Reply
#2

And what`s your problem / error?

Try using:
pawn Код:
if(pickupid == THCSPA)
{
    //blabla
}
if(pickupid == THCM4)
{
   //blabla
}
if(pickupid == THCSPA)
{
   //blabla
}
And so on, only if statements and yes, like AlexzzPro said, use CreatePickup.
Reply
#3

Addstaticpickup does not work with that. Use createpickup instead. And then make like antonio
Reply
#4

Quote:
Originally Posted by AlexzzPro
Посмотреть сообщение
Addstaticpickup does not work with that. Use createpickup instead. And then make like antonio
Righto, thank you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)