Pickups dont work at all ;/ - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Pickups dont work at all ;/ (
/showthread.php?tid=266348)
Pickups dont work at all ;/ -
Moron - 04.07.2011
Whenever i go to a pickup nothing happens. I just had to change some things to add 3DTextLabels above each business pickup. Everything else works fine.
I add pickups like this:
Код:
CreateBussiness(260,600000,"Business", -2221.806640, 134.178909, 1035.632812);
Код:
forward Payday();
enum bitem
{
moka,
bizkaina,
pavadinimas[128],
bpinigai,
own_name[MAX_PLAYER_NAME],
pickupas
}
new bussinesDB[400][bitem];
stock CreateBussiness( bmoka, bkaina, bpavadinimas[], Float:x, Float:y, Float:z )
{
new
str[ 128 ],
Text3D:btext
;
bussinesDB[ _:btext ][ pickupas ] = CreatePickupA(1318 , 2,x,y,z);
format( str, 128, "{ffffff}Pavadinimas:{ee5555} %s\n{ffffff}Kaina:{ee5555} %dLt\n{ffffff}Pelnas:{ee5555} %dLt", bpavadinimas, bkaina, bmoka );
btext = Create3DTextLabel( str, 0x6FA7FBFF, x, y, z, 40.0, 0 );
bussinesDB[ _:btext ][ moka ] = bmoka*4;
bussinesDB[ _:btext ][ bizkaina ] = bkaina;
strmid( bussinesDB[ _:btext ][ pavadinimas ], bpavadinimas, 0, 128, 128 );
return _:btext;
}
Код:
if(pickupid == bussinesDB[pickupid][pickupas])
{
new msg[128],name[MAX_PLAYER_NAME];
format(msg,sizeof(msg),"=== %s ===",bussinesDB[pickupid][pavadinimas]);
SendClientMessage(playerid,COLOR,msg);
GetPlayerName(playerid,name,sizeof(name));
if(!strcmp(bussinesDB[pickupid][own_name],name,true))
{
SendClientMessage(playerid,COLOR,"* Biznis priklauso jums.");
SendClientMessage(playerid,COLOR,"* Apleisti bizni? [taip/ne]");
playerDB[playerid][rid][2]=pickupid;
playerDB[playerid][textas]=5;
return 1;
}
if(!strcmp(bussinesDB[pickupid][own_name],"no",true))
{
if(playerDB[playerid][biznis] != 0)
{
SendClientMessage(playerid,COLOR,"* Biznis parduodamas, taciau jus jau turite bizni.");
return 1;
}
if(GetPlayerScore(playerid) < 7000)
{
SendClientMessage(playerid,COLOR,"* Biznis parduodamas, bet jusu dar niekas nepazista. Biznio pirkti negalite.");
SendClientMessage(playerid,COLOR,"* Patarimas: Pazaiskite siame serveryje daugiau!");
return 1;
}
SendClientMessage(playerid,COLOR,"* Biznis parduodamas.");
format(msg,sizeof(msg),"Kaina: %i LT.",bussinesDB[pickupid][bizkaina]);
SendClientMessage(playerid,COLOR,msg);
format(msg,sizeof(msg),"Maksimalus pelnas: %i LT/val.",bussinesDB[pickupid][moka]);
SendClientMessage(playerid,COLOR,msg);
SendClientMessage(playerid,COLOR,"* Ar notite pirkti si bizni? [taip/ne]");
playerDB[playerid][rid][4]=pickupid;
playerDB[playerid][textas]=6;
return 1;
}
format(msg,sizeof(msg),"Biznis priklauso: %s",bussinesDB[pickupid][own_name]);
SendClientMessage(playerid,COLOR,msg);
return 1;
}
Re: Pickups dont work at all ;/ -
Moron - 05.07.2011
BUMP.
Re: Pickups dont work at all ;/ -
Jochemd - 05.07.2011
Shouldn't you run a loop to check the Pickup ID, instead of using PickupID in it?
Re: Pickups dont work at all ;/ -
Moron - 05.07.2011
I dont understand. What do i need to do?