[Tutorial] Advanced Capturable Zone Scripting [Easy,Very Fast,Efficient,Variable Time TO Capture For DONOR , More STOCKS ,Foreach]
#7

Quote:
Originally Posted by Rajat_Pawar
Посмотреть сообщение
You have a major error in there:
pawn Код:
enum CaptureInfo
{
    gAttacked = 0,
    gOwner = 0,
}
I am sure you wanted to set the variables to 0.

Read in this (https://sampforum.blast.hk/showthread.php?tid=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 Код:
#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?
Reply


Messages In This Thread
Advanced Capturable Zone Scripting [Easy,Very Fast,Efficient,Variable Time TO Capture For DONOR , More STOCKS ,Foreach] - by kN1GhT - 23.11.2013, 16:30
Re: Advanced Capturable Zone Scripting [Easy,Very Fast,Efficient,Variable Time TO Capture For DONOR , More STOCKS ,Forea - by _Mohit_ - 24.11.2013, 11:27
Re: Advanced Capturable Zone Scripting [Easy,Very Fast,Efficient,Variable Time TO Capture For DONOR , More STOCKS ,Forea - by JimmyCh - 24.11.2013, 17:15
Re: Advanced Capturable Zone Scripting [Easy,Very Fast,Efficient,Variable Time TO Capture For DONOR , More STOCKS ,Forea - by kN1GhT - 24.11.2013, 20:24
Re: Advanced Capturable Zone Scripting [Easy,Very Fast,Efficient,Variable Time TO Capture For DONOR , More STOCKS ,Forea - by Raza2013 - 25.11.2013, 10:43
Re: Advanced Capturable Zone Scripting [Easy,Very Fast,Efficient,Variable Time TO Capture For DONOR , More STOCKS ,Forea - by RajatPawar - 25.11.2013, 11:16
Re: Advanced Capturable Zone Scripting [Easy,Very Fast,Efficient,Variable Time TO Capture For DONOR , More STOCKS ,Forea - by kN1GhT - 25.11.2013, 14:25
Re: Advanced Capturable Zone Scripting [Easy,Very Fast,Efficient,Variable Time TO Capture For DONOR , More STOCKS ,Forea - by RajatPawar - 25.11.2013, 14:34
Re: Advanced Capturable Zone Scripting [Easy,Very Fast,Efficient,Variable Time TO Capture For DONOR , More STOCKS ,Forea - by JimmyCh - 25.11.2013, 18:09
Re: Advanced Capturable Zone Scripting [Easy,Very Fast,Efficient,Variable Time TO Capture For DONOR , More STOCKS ,Forea - by kN1GhT - 26.11.2013, 08:09
Re: Advanced Capturable Zone Scripting [Easy,Very Fast,Efficient,Variable Time TO Capture For DONOR , More STOCKS ,Forea - by xF4Life - 28.11.2013, 14:35
Re: Advanced Capturable Zone Scripting [Easy,Very Fast,Efficient,Variable Time TO Capture For DONOR , More STOCKS ,Forea - by TahaAsif12 - 28.11.2013, 15:27
Re: Advanced Capturable Zone Scripting [Easy,Very Fast,Efficient,Variable Time TO Capture For DONOR , More STOCKS ,Forea - by kN1GhT - 29.11.2013, 00:28
Re: Advanced Capturable Zone Scripting [Easy,Very Fast,Efficient,Variable Time TO Capture For DONOR , More STOCKS ,Forea - by HydraHumza - 13.03.2015, 09:50

Forum Jump:


Users browsing this thread: 1 Guest(s)