24.12.2011, 12:34
Quote:
Silly me! It does work with existing names, but not the new created gangs. How would I be able to store the new gang name into that enum in gangcreate command?
Edit: Tried something like this but it does not work: pawn Код:
|
pawn Код:
for(new i; i < sizeof(GangInfo); i++)
{
if(!strlen(GangInfo[i][gName])) //If it's empty (not used)
{
format(GangInfo[i][gName], MAX_GANG_NAME, TheVariableToStore); //Put the name in the variable that is empty.
break; //Exit the loop, it's no longer needed
}
}
Edit: Just taken a look at your loop in your original post. You should use 'sizeof(GangInfo)' (or a size definition) rather than the actual GangInfo[i][gName] identifier in your loop header. (Take a look at my example above)