28.04.2010, 12:03
How can i make admins avaible to use NoN-RP names like " Nature, Molp, lewis " etc. not Nature_Wood or Molp_Koop etc..
stock split(const strsrc[], strdest[][], delimiter)
{
new i, li;
new aNum;
new len;
while(i <= strlen(strsrc))
{
if(strsrc[i] == delimiter || i == strlen(strsrc))
{
len = strmid(strdest[aNum], strsrc, li, i, 128);
strdest[aNum][len] = 0;
li = i+1;
aNum++;
}
i++;
}
return 1;
}
new
var[2][MAX_PLAYER_NAME],
pName[MAX_PLAYER_NAME] = "Nature_Wood" // You have to use GetPlayerName instead this btw.
;
split(pName, var, '_');
printf("Output: %s", var[0]);
Output: Nature