help me Scrip
#2

It would work but it's not very well done.

For example, you repeatedly call GetPlayerWeapon (which always returns the same value) but you could store the value in a variable and then compare it (it's a bit more efficient, not that this would make any noticable difference, but still).

Something like this:

Код:
new weaponid = GetPlayerWeapon(playerid);
And then use weaponid instead of GetPlayerWeapon.

Furthermore you can use a switch statement for things like these:

Код:
switch(weaponid)
{
case 16, 17, 35: // etc... You need to add the other IDs too
{
Kick(playerid);
}
}
Which makes it easier to code and to read.
You could also use the existing defines (like "WEAPON_MINIGUN") which is also easier to maintain because you will not have to look through Weapon IDs.
Reply


Messages In This Thread
help me Scrip - by nbx2000 - 20.06.2018, 02:47
Re: help me Scrip - by NaS - 20.06.2018, 03:20

Forum Jump:


Users browsing this thread: 2 Guest(s)