String problem
#1

Why i can't see full player name who type command

Код:
new string[128], name[75];
GetPlayerName(playerid, name, 75);
format(string,sizeof(string),"{B5B5B5}%s(%d): has used command %s",name[playerid],playerid,cmdtext);
for(new i=0;i<MAX_PLAYERS;i++)
{
if(pInfo[i][pLevel] > 1)
SendClientMessage(i,-1,string);
}
return 1;
}
Reply
#2

MAX_PLAYER_NAME = 24.
You're defining the player's name size as 75, Make it 24 and to show it just use 'name', without '[playerid]'.
Reply
#3

Why are you using a 75 long string? Player names are not longer than 24 characters, so you should just use name[24] or name[MAX_PLAYER_NAME] MAX_PLAYER_NAME = 24 by default
Код:
format(string,sizeof(string),"{B5B5B5}%s(%d): has used command %s",name[playerid],playerid,cmdtext);
you declared the variable as name[75] and you use name[playerid]? It doesn't make any sense,
use this instead
PHP код:
format(string,sizeof(string),"{B5B5B5}%s(%d): has used command %s",name,playerid,cmdtext); 
EDIT: sorry oMa37, didn't refresh the page
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)