Question about Name's and getting them
#1

So is this better

PHP код:
new playerName[MAX_PLAYERS][MAX_PLAYER_NAME];
public 
OnPlayerConnect(playerid)
{
    
GetPlayerName(playeridPlayer_Name[playerid], MAX_PLAYER_NAME);
    return 
1;
// Don't mind not reseting it I know just giving an example 
Or

PHP код:
stock GetName(playerid)
{
    new 
Nick[MAX_PLAYER_NAME];
    
GetPlayerName(playeridNicksizeof(Nick));
    return 
Nick;

Command Example with GetName
PHP код:
CMD:kick(playeridparams[])
{
    new
        
id,
        
reason[100];
    if (
sscanf(params"rs[100]"idreason)) return // syntax..
    // ...
    
new
        
string[128],
        
ip[16];
    
GetPlayerIp(idip16);
    
format(stringsizeof (string), "You have been kicked by %s. Reason: %s"GetName(playerid), reason);
    
SendClientMessage(id, -1string);
    
format(stringsizeof (string), "You kicked %s. Reason: %s"GetName(id), reason);
    
SendClientMessage(playerid, -1string);
    
format(stringsizeof (string), "%s kicked %s. Reason: %s"GetName(playerid), GetName(id), reason);
    
SendClientMessageToAll(id, -1string);
    
format(stringsizeof (string), "%s kicked %s [IP: %s]. Reason: %s"GetName(playerid), GetName(id), ipreason);
    
SendMessageToAdmins(-1string);
    
    
// kick player..
    
return 1;

In this command would the first example be better or the second one?
Reply


Messages In This Thread
Question about Name's and getting them - by IdonTmiss - 07.11.2018, 13:45
Re: Question about Name's and getting them - by v1k1nG - 07.11.2018, 15:52
Re: Question about Name's and getting them - by CaptainBoi - 07.11.2018, 15:58
Re: Question about Name's and getting them - by Ermanhaut - 07.11.2018, 16:04
Re: Question about Name's and getting them - by Gforcez - 08.11.2018, 14:22
Re: Question about Name's and getting them - by v1k1nG - 08.11.2018, 15:29
Re: Question about Name's and getting them - by cSharp - 08.11.2018, 15:38
Re: Question about Name's and getting them - by TheToretto - 08.11.2018, 18:14
Re: Question about Name's and getting them - by SyS - 09.11.2018, 01:17

Forum Jump:


Users browsing this thread: 1 Guest(s)