View Single Post
Old 25/11/2013, 02:25 PM   #7
kN1GhT
Banned
 
Join Date: Jun 2013
Posts: 151
Reputation: 26
Default Re: Advanced Capturable Zone Scripting [Easy,Very Fast,Efficient,Variable Time TO Capture For DONOR , More STOCKS ,Forea

Quote:
Originally Posted by Rajat_Pawar View Post
You have a major error in there:
pawn Code:
enum CaptureInfo
{
    gAttacked = 0,
    gOwner = 0,
}
I am sure you wanted to set the variables to 0.

Read in this (http://forum.sa-mp.com/showthread.php?t=318307) topic that setting to constants in enums sets their POSITION and not their value. Hence gOwner and gAttacked would be BOTH at the position 0 which is not good.

Example - try running this code here. (http://slice-vps.nl:7070/)
pawn Code:
#include <a_samp>

enum r_EXAMPLE
{
    my_position_is_5 = 5,
    my_position_is_10 = 10
}
new rEnum[ 1 ][ r_EXAMPLE ];

main()
{
    printf(" %i, %d ", rEnum[ 0 ][ my_position_is_5 ], rEnum[ 0 ][my_position_is_10] );
}

It returns "0, 0" and not "5, 10".
Ok understood

But let me ask u something
Would this really affect the efficiency of the code by a very large scale?
kN1GhT is offline   Reply With Quote