[HELP] Admin shita - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] Admin shita (
/showthread.php?tid=144624)
[HELP] Admin shita -
andershh - 28.04.2010
How can i make admins avaible to use NoN-RP names like " Nature, Molp, lewis " etc. not Nature_Wood or Molp_Koop etc..
Re: [HELP] Admin shita -
RyDeR` - 28.04.2010
There are different ways to handle this but I prefer to use the split function: >.>
pawn Код:
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;
}
So this will be: >>
pawn Код:
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]);
Re: [HELP] Admin shita -
andershh - 28.04.2010
Thanks!