22.08.2012, 09:19
pawn Код:
stock GetPlayerLastName(playerid)
{
new name[24];
GetPlayerName(playerid,name,24);
new pos = strfind(name,"_");
if(pos != -1)
{
strdel(name,0,pos+1);
}
return name;
}
CMD:lastname(playerid)
{
new str[128];
format(str,sizeof(str),"Your last name is %s",GetPlayerLastName(playerid));
SendClientMessage(playerid,0xFFFFFFFF,str);
return 1;
}
or
pawn Код:
stock GetLastName(fullname[])
{
new str[24];
new pos = strfind(fullname,"_");
if(pos != -1)
{
strdel(fullname,0,pos+1);
}
format(str,sizeof(str),"%s",fullname);
return str;
}