SA-MP Forums Archive
[Ajuda] AFK MOTIVO . - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] AFK MOTIVO . (/showthread.php?tid=583001)



AFK MOTIVO . - JuniorTheDM - 24.07.2015

PHP код:
CMD:afk(playeridparams[])
{
    new 
string[64], motivo[64];
    if(!
AFK[playerid])
    {
        if(
sscanf(params"us[64]"motivo))
        {
        
SendClientMessage(playerid, -1"Digite: /afk [motivo]");
        return 
1;
        }
        {
        
format(stringsizeof string"[AFK]O Jogador (%s) Estб AFK, Motivo: %s"PlayerName(playerid), motivo);
        
SendClientMessageToAll(-1string);
        }
        
SetPlayerPos(playerid322.197998,302.497985,999.148437);
        
SetPlayerInterior(playerid5);
        
SetPlayerHealth(playerid9999);
        
ResetPlayerWeapons(playerid);
        
AFK[playerid] = true;
    } 
e a MSG Aparece Assim : [AFK]O Jogador (%s) Estб AFK, Motivo: ~y


Re: AFK MOTIVO . - HaRdiiZin - 24.07.2015

Quote:

CMD:afk(playerid, params[])
{
new string[64], motivo[64];

if(!AFK[playerid])
{
if(sscanf(params, "us[64]", motivo))
{
SendClientMessage(playerid, -1, "Digite: /afk [motivo]");
return 1;
}
{
format(string, sizeof string, "[AFK]O Jogador (%s) Estб AFK, Motivo: %s", PlayerName(playerid), motivo);
SendClientMessageToAll(-1, string);
}
SetPlayerPos(playerid, 322.197998,302.497985,999.148437);
SetPlayerInterior(playerid, 5);
SetPlayerHealth(playerid, 9999);
ResetPlayerWeapons(playerid);
AFK[playerid] = true;
}

Quote:

CMD:afk(playerid, params[])
{
new string[64], motivo[64];

if(!AFK[playerid])
{
if(sscanf(params, "s", motivo))
{
SendClientMessage(playerid, -1, "Digite: /afk [motivo]");
return 1;
}
{
format(string, sizeof string, "[AFK]O Jogador (%s) Estб AFK, Motivo: %s", PlayerName(playerid), motivo);
SendClientMessageToAll(-1, string);
}
SetPlayerPos(playerid, 322.197998,302.497985,999.148437);
SetPlayerInterior(playerid, 5);
SetPlayerHealth(playerid, 9999);
ResetPlayerWeapons(playerid);
AFK[playerid] = true;
}

~~~~ Dк uma olhada aqui.


Re: AFK MOTIVO . - humildadeforever - 24.07.2015

Nem precisa de sscanf

PHP код:
CMD:afk(playeridparams[])
{
    new 
string[64], motivo[64];
    if(!
AFK[playerid])
    {
        if(
isnull(params)) return SendClientMessage(playerid, -1"Digite: /afk [motivo]");
        
format(stringsizeof string"[AFK]O Jogador (%s) Estб AFK, Motivo: %s"PlayerName(playerid), params);
        
SendClientMessageToAll(-1string);
        
SetPlayerPos(playerid322.197998,302.497985,999.148437);
        
SetPlayerInterior(playerid5);
        
SetPlayerHealth(playerid9999);
        
ResetPlayerWeapons(playerid);
        
AFK[playerid] = true;
    }
    return 
1;