dynamic 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: dynamic pickups (
/showthread.php?tid=497295)
dynamic pickups -
Knekt - 26.02.2014
I got an array with enter/exit etc.
To the point, I can only create one pickup and it will work , if I decide to create another one it simply fucks up and my msg that I added upon entering the checkpoint seem to not be working.
Anyhow here's the code:
I simply don't know how to make them individual or whatever, every store in the array has it's seperate ID.
ALocations[i][ID]
Код:
new Enter;
new Exit;
new Shop;
stock Pickups()
{
for(new i; i < sizeof(ALocations); i++)
{
Enter = CreateDynamicPickup(19198, 1, ALocations[i][EntX], ALocations[i][EntY], ALocations[i][EntZ], 0, 0, -1, 200.0);
Exit = CreateDynamicPickup(19198, 1, ALocations[i][ExiX], ALocations[i][ExiY], ALocations[i][ExiZ], ALocations[i][Vw], ALocations[i][Interior], -1, 200.0);
}
return 1;
}
stock Checkpoints()
{
for(new i; i < sizeof(ALocations); i++)
{
Shop = CreateDynamicCP(ALocations[i][robX], ALocations[i][robY], ALocations[i][robZ], 2, ALocations[i][Vw], ALocations[i][Interior], -1, 100.0);
}
return 1;
}
public OnPlayerPickUpDynamicPickup(playerid, pickupid)
{
for(new i; i < sizeof(ALocations); i++)
{
if(pickupid == Enter)
{
SetPlayerPos(playerid, ALocations[i][ExiX], ALocations[i][ExiY], ALocations[i][ExiZ]);
SetPlayerFacingAngle(playerid, ALocations[i][ExiF]);
SetPlayerInterior(playerid, ALocations[i][Interior]);
SetPlayerVirtualWorld(playerid, ALocations[i][Vw]);
return 1;
}
if(pickupid == Exit)
{
SetPlayerPos(playerid, ALocations[i][EntX], ALocations[i][EntY], ALocations[i][EntZ]);
SetPlayerFacingAngle(playerid, ALocations[i][EntF]);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
return 1;
}
if(pickupid == Shop)
{
ShopDialog(playerid);
}
}
return 1;
}
EDIT: stupid mistake regarding the checkpoint, only question now is how to make 2 or more pickups work without mixing up, I got ID's assigned to each store in the array, any clue?
Re: dynamic pickups -
amirab - 26.02.2014
define MAX_PICKUPS and then use "for()" for that
Exit[i]
Enter[i]