SA-MP Forums Archive
pickup help - 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: pickup help (/showthread.php?tid=655676)



pickup help - KratosRoG - 27.06.2018

i created pickup . now i want to get nrg OnPlayerPickUpPickup help pls.


Re: pickup help - div - 27.06.2018

CreateVehicle(model, x, y, z, rot, 0, 0, 200); //Model id and u can getplayerpos or spawn an nrg at the pickup's pos...
PutPlayerInVehicle(playerid, model, 0); // here we put the player inside the vehicle..


Re: pickup help - Mike861 - 27.06.2018

Код:
public OnPlayerPickupPickup(playerid, pickupid)
{
    if(pickupid == urpickup)
    {
       CreateVehicle(522, x, y, z, a, -1, -1, 60);
    }
    return 1;
}
Something like that, but if u want you can try using PutPlayerInVehicle and stuff like that


Re: pickup help - KratosRoG - 27.06.2018

yeah its working but its spawning in virtual world 0 i use this SetVehicleVirtualWorld but still nrg going in vw 0
i want in vw 4


Re: pickup help - GTLS - 27.06.2018

Show the code you have. Just this pickup.


Re: pickup help - KratosRoG - 27.06.2018

new pickupnrg;

public OnGameModeInit()
{
pickupnrg = CreatePickup(1318, 2, 790.2700,-2129.1924,60.8927, 4);
}

if(pickupid == pickupnrg)
{
new vehicleid = GetPlayerVehicleID(playerid);
CreateVehicle(522, 790.2700,-2129.1924,60.8927,34.8686, -1, -1, 60);
SetVehicleVirtualWorld(522, 4);
PutPlayerInVehicle(playerid, vehicleid, 0);
}

is this correct ?
i can see arrow pickup in virtual world 4 but its not spawning nrg when pickup


Re: pickup help - Mike861 - 27.06.2018

Did u try replacing id 522 with vehicleid in set vehicle virtual world?


Re: pickup help - KratosRoG - 27.06.2018

Quote:
Originally Posted by Mike861
Посмотреть сообщение
Did u try replacing id 522 with vehicleid in set vehicle virtual world?
yes i did same thing happening


Re: pickup help - Mike861 - 27.06.2018

Код:
new nrg;
nrg = CreateVehicle(522, 790.2700,-2129.1924,60.8927,34.8686, -1, -1, 60);
SetVehicleVirtualWorld( nrg, 4 );
Try doing it this way


Re: pickup help - KratosRoG - 27.06.2018

now its working ! thank you so much Mike.
+1 rep