username splitting sscanf
#6

Quote:
Originally Posted by pollo97
Посмотреть сообщение
Is that you were looking for?

Код:
        new startpos = strfind("@Kalcor#2006","@");
        if(startpos==-1) SendClientMessage(playerid,-1,"@ not found");
        new endpos = strfind("@Kalcor#2006","#");
        if(endpos==-1) SendClientMessage(playerid,-1,"# not found");
				
        new string[64];
	new discriminator[16];
	strmid(string,"@Kalcor#2006",startpos,endpos);
	strmid(discriminator,"@Kalcor#2006",endpos,strlen("@Kalcor#2006"));
strmid should extract from start+1 on first and endpos+1 in second to get string without "@" or "#"
your code now provides @Kalcor and #2006
Quote:
Originally Posted by Zorono
Посмотреть сообщение
Thanks @Sys for your help
This one is great but thats not what i mean 60% it spllits those symbols and then adds then in the same variable (i need each one on an variable as @poll97 did using strmid) but anyway thanks alot sir
if you want the discriminator just unquiet the third specifier
PHP код:
new name[]="@Kalcor#2006",updated_name[10],discriminator[10]; 
sscanf(name,"P<@#>{s[10]}s[10]s[10]",updated_name,discriminator); 
Reply


Messages In This Thread
username splitting sscanf - by Zorono - 24.11.2017, 11:17
Re: username splitting sscanf - by pollo97 - 24.11.2017, 13:24
Re: username splitting sscanf - by Zorono - 24.11.2017, 13:56
Re: username splitting sscanf - by SyS - 24.11.2017, 14:05
Re: username splitting sscanf - by Zorono - 24.11.2017, 14:35
Re: username splitting sscanf - by SyS - 24.11.2017, 14:48
Re: username splitting sscanf - by GhostHacker9 - 24.11.2017, 14:53
Re: username splitting sscanf - by ThePhenix - 24.11.2017, 15:45
Re: username splitting sscanf - by Meller - 24.11.2017, 15:49
Re: username splitting sscanf - by Zorono - 25.11.2017, 08:06

Forum Jump:


Users browsing this thread: 1 Guest(s)