25.03.2008, 08:55
I haven't looked at your code but I would recomend not having the ID in the AddProp function. Use a counter in the actuall function like so:
You can use the ID like this then:
And check it like this:
Like I said I was just reading the post and thought it may be an idea for you. Good idea either way, I like all these simple (as in makes things simple for the user) includes.
pawn Код:
new gPropCount = -1,
Float:gProps[ 20 ][ 5 ] = {.......... //x, y, z, radius, cp size or whatever....
AddProp.....( Float:x, Float:y.............
{
gPropCount ++;
gProps[ gPropCount ][ 0 ] = x;
gProps[ gPropCount ][ 1 ] = y;
//etc.....
return gPropCount;
}
pawn Код:
new gWangs;
public OnGameModeInit()
{
gWangs = AddProp....................
}
pawn Код:
OnPlayerEnterProperty( playerid, propid )
{
if ( propid == gWangs )
{.......}