Jump to content
  • 0

Problema /pm


GiGiMuScHi

Question

Am o problema la comanda /pm. Cand un pleyer incearca sa trimita un /pm la un alt player zice ca nu ii online. Alta chestie este ca nu la toti playerii se intampla aceasta problema.

if(strcmp(cmd, "/pm", true) == 0 || strcmp(cmd, "/pme", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

        if(gPlayerLogged[playerid] == 0)

        {

            SendClientMessage(playerid, COLOR_GREY, "  You havent logged in yet!");

            return 1;

        }

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/p)me [playerid/PartOfName] [text]");

return 1;

}

giveplayerid = ReturnUser(tmp);

if (IsPlayerConnected(giveplayerid))

{

if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pHelper] >= 1)

{

    if(giveplayerid != INVALID_PLAYER_ID)

    {

        if(HidePM[giveplayerid] > 0)

        {

            SendClientMessage(playerid, COLOR_GREY, "  That player is blocking messages!");

            return 1;

        }

GetPlayerName(playerid, sendername, sizeof(sendername));

GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));

if(giveplayerid == playerid)

{

format(string, sizeof(string), "* %s mutters something to himself.", sendername);

ProxDetector(5.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);

}

new length = strlen(cmdtext);

while ((idx < length) && (cmdtext[idx] <= ' '))

{

idx++;

}

new offset = idx;

new result[64];

while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))

{

result[idx - offset] = cmdtext[idx];

idx++;

}

result[idx - offset] = EOS;

if(!strlen(result))

{

SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/p)me [playerid/PartOfName] [text]");

return 1;

}

format(string, sizeof(string), "[iD:%d] %s pm: %s", playerid, sendername, (result));

SendClientMessage(giveplayerid, 0xBBA033AA, string);

format(string, sizeof(string), "PM sent to [iD:%d]%s: %s", giveplayerid, giveplayer, (result));

SendClientMessage(playerid,  0xE5C43EAA, string);

format(string, sizeof(string), "%s pm to %s: %s", sendername, giveplayer, (result));

PmLog(string);

return 1;

}

}

else

{

format(string, sizeof(string), "  %d is not an active player.", giveplayerid);

SendClientMessage(playerid, COLOR_GRAD1, string);

}

}

}

return 1;

}

Ma puteti ajutati cu aceata problema?

Respecta Si Vei Fi Respectat !!!

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.