SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 12/08/2012, 10:23 AM   #1
ShawtyyMacJunior
Big Clucker
 
Join Date: Jun 2012
Posts: 77
Reputation: 0
Default Pickups acting as other pickups [HELP]

Why are my pickups not doing their codes i set for them, yet they do the code that i set for another pickup.

Heres the codes

Code:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == LVL2Pickup)
	{
	    SetPlayerPos(playerid, 951.09997558594, 2144.1000976563, 1011);
		GameTextForPlayer(playerid,"~r~I WANT TO PLAY A GAME",5000,5);
		return 1;
	}
	if(pickupid == TrapPickup)
	{
     	SetPlayerPos(playerid, 935.3141,2144.1475,1013.7524);
	    SetPlayerFacingAngle( playerid, 272.7581);
	    TogglePlayerControllable(playerid, 0);
	    SetPlayerSpecialAction(playerid,SPECIAL_ACTION_HANDSUP);
		GameTextForPlayer(playerid,"~r~I WANT TO PLAY A GAME",5000,5);
		SetCameraBehindPlayer(playerid);
		DestroyPickup(TrapPickup);
		return 1;
	}
	return 1;
}
Whats wrong with this?
ShawtyyMacJunior is offline   Reply With Quote
Old 12/08/2012, 10:31 AM   #2
Ronaldo_raul™
High-roller
 
Ronaldo_raul™'s Avatar
 
Join Date: Jun 2010
Location: .
Posts: 1,013
Reputation: 67
Default Re: Pickups acting as other pickups [HELP]

pawn Code:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == LVL2Pickup)
    {
        SetPlayerPos(playerid, 951.09997558594, 2144.1000976563, 1011);
        GameTextForPlayer(playerid,"~r~I WANT TO PLAY A GAME",5000,5);
        return 1;
    }
    if(pickupid == TrapPickup)
    {
        SetPlayerPos(playerid, 935.3141,2144.1475,1013.7524);
        SetPlayerFacingAngle( playerid, 272.7581);
        TogglePlayerControllable(playerid, 0);
        SetPlayerSpecialAction(playerid,SPECIAL_ACTION_HANDSUP);
        GameTextForPlayer(playerid,"~r~I WANT TO PLAY A GAME",5000,5);
        SetCameraBehindPlayer(playerid);
        DestroyPickup(TrapPickup);
        return 1;
    }
    return 0;  //You have to return 0 over here.
}
Ronaldo_raul™ is offline   Reply With Quote
Old 12/08/2012, 12:50 PM   #3
Vince
Spam Machine
 
Vince's Avatar
 
Join Date: Sep 2007
Location: Belgium
Posts: 10,962
Reputation: 2649
Default Re: Pickups acting as other pickups [HELP]

If you are using AddStaticPickup, then change it to CreatePickup. AddStaticPickup doesn't return any value.
__________________
Vince is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pickups/3DTexts don't show on house pickups - Help ! Edvin Scripting Help 1 21/06/2012 08:50 PM
[URGENT] I need a list of pickups with thier ids The new 0.3c pickups AMEENAMEEN Scripting Help 1 14/04/2012 06:12 PM
Help with "Pickups Max = 100, Current Pickups = 150" >>R15KY<< Scripting Help 11 11/09/2011 07:33 PM
Help with pickups 0.3 BurnOutt Help Archive 9 25/10/2009 08:02 PM


All times are GMT. The time now is 03:06 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.