How to reget the origin player name
#8

To cause you less confusion, I just edited your code.

PHP код:
COMMAND:afk(playeridparams[])
{
       
SendAdminText(playerid"/afk"params);
    if (
APlayerData[playerid][LoggedIn] == false) return 0;
    if (
GetPVarInt(playerid"AFK") == 1)
        return 
SendClientMessage(playerid, -1"You are already AFK!");
    new 
Name[24], string[128];
    
TogglePlayerControllable(playerid,0);
    
GetPlayerName(playeridNamesizeof(Name));
    
SetPVarString(playerid"PreviousName"Name);
    
SetPVarInt(playerid"AFK"1); // To indicate that the player is AFK
    
format(stringsizeof(string), "%s[AFK]"Name);
    
SetPlayerName(playeridstring);
    
format(stringsizeof(string), "Le joueur %s c'est mis afk !"Name);
    
SendClientMessageToAll(-1string);
    
// message afk
    
SendClientMessage(playerid, -1"Vous etes maintenant afk !");
    return 
1;
}
COMMAND:stopafk(playeridparams[])
{
    
SendAdminText(playerid"/stopafk"params);
    if (
APlayerData[playerid][LoggedIn] == false) return 0;
    if (
GetPVarInt(playerid"AFK") == 0)
        return 
SendClientMessage(playerid, -1"You are not AFK!");
    new 
Name[24], string[128];
    
TogglePlayerControllable(playerid1);
    
GetPVarString(playerid"PreviousName"Namesizeof(Name));
    
SetPlayerName(playeridName);
    
format(stringsizeof(string),"Le joueur %s est de retour !"Name);
    
SendClientMessageToAll(-1string);
    
// message afk
    
SendClientMessage(playerid,-1"Vous etes maintenant de retour !");
    
DeletePVar(playerid"PreviousName");
    
SetPVarInt(playerid"AFK"0);
    return 
1;

Reply


Messages In This Thread
How to reget the origin player name - by Eymeric69 - 17.05.2016, 14:51
Re: How to reget the origin player name - by SyS - 17.05.2016, 14:54
Re: How to reget the origin player name - by Sjn - 17.05.2016, 14:59
Re: How to reget the origin player name - by Eymeric69 - 17.05.2016, 15:03
Re: How to reget the origin player name - by Konstantinos - 17.05.2016, 15:14
Re: How to reget the origin player name - by GhostHacker - 17.05.2016, 15:18
Re: How to reget the origin player name - by SyS - 17.05.2016, 15:20
Re: How to reget the origin player name - by Sjn - 17.05.2016, 15:23
Re: How to reget the origin player name - by Eymeric69 - 17.05.2016, 15:25
Re: How to reget the origin player name - by bgedition - 17.05.2016, 18:11

Forum Jump:


Users browsing this thread: 2 Guest(s)