SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 15/02/2019, 11:25 PM   #11
EmpireSk
Huge Clucker
 
EmpireSk's Avatar
 
Join Date: Jul 2013
Location: Slovakia
Posts: 356
Reputation: 10
Default Re: GetWeaponPickupCreatePos

Hmmm.... Help me boys
__________________
EmpireSk is offline   Reply With Quote
Old 16/02/2019, 01:21 PM   #12
TheToretto
Gangsta
 
TheToretto's Avatar
 
Join Date: Jul 2015
Posts: 600
Reputation: 66
Default Re: GetWeaponPickupCreatePos

Quote:
Originally Posted by EmpireSk View Post
My code can not be fixed....? Because when I erase a symbol "&" so error is not, but servers will not show weapons
Your code means nothing, the "number" argument is unknown, what is its job? And I wrote you a function up. Use it instead.

Quote:
Originally Posted by TheToretto View Post
Why not.

Code:
new WeaponsObject[] = {
    1239,331,333,334,335,336,337,338,
    339,341,321,322,323,324,325,326,
    342,343,344,1239,1239,1239,346,
    347,348,349,350,351,352,353,355,
    356,372,357,358,359,360,361,362,
    363,364,365,366,367,368,369,371
};

#define ReturnWeapon(%0) WeaponsObject[%0]

CreateWeaponPickup(weaponid, Float:x, Float:y, Float:z)
{
    weaponid = ReturnWeapon(weaponid);
    CreateDynamicPickup(weaponid, 1, x, y, z, -1, -1, -1, STREAMER_PICKUP_SD);
    return 1;
}
Notice some invalid weapons ID's values were replaced by 1239.
__________________






Toretto#9902

Rest in peace grandpa, 03 November 2018
TheToretto is offline   Reply With Quote
Old 17/02/2019, 11:35 AM   #13
EmpireSk
Huge Clucker
 
EmpireSk's Avatar
 
Join Date: Jul 2013
Location: Slovakia
Posts: 356
Reputation: 10
Default Re: GetWeaponPickupCreatePos

And will it work ...? is it instead?
__________________
EmpireSk is offline   Reply With Quote
Old 17/02/2019, 11:46 AM   #14
J0sh...
Banned
 
Join Date: Aug 2014
Location: Hamburger
Posts: 1,298
Reputation: 461
Default Re: GetWeaponPickupCreatePos

What's even the point of that macro at all? There's no need for it and heck, its bad practice.
J0sh... is offline   Reply With Quote
Old 17/02/2019, 12:48 PM   #15
TheToretto
Gangsta
 
TheToretto's Avatar
 
Join Date: Jul 2015
Posts: 600
Reputation: 66
Default Re: GetWeaponPickupCreatePos

Quote:
Originally Posted by EmpireSk View Post
And will it work ...? is it instead?
Try it...

Quote:
Originally Posted by J0sh... View Post
What's even the point of that macro at all? There's no need for it and heck, its bad practice.
Yeah it's just to make it more readable without having to name the variable, it is optional and useless.

Quote:
Originally Posted by ****** View Post
Why?
Because in his last switch statement it had:

Code:
default: return 1239;
So I replaced all the invalid weapons slots by that, which are between:

Code:
case 18: return 344;
case 22: return 346;
So 19-20-21 were invalid.
__________________






Toretto#9902

Rest in peace grandpa, 03 November 2018
TheToretto 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



All times are GMT. The time now is 03:38 PM.


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