Need help about chat
#7

pawn Код:
CMD:pm(playerid, params[])
{
    new string[128],msg[128], id, Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME];
    if(sscanf(params, "us[128]", id, msg)) //Using 's' in sscanf is to signify a string, you have to signify the size aswell though.. so "us[128]"
    {
        return SendClientMessage(playerid, -1, "USE: {FFFF00}/pm {FFFFFF}<id> <message>");
    }
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid, red,"ERROR: {FFFFFF} Player not connected");
    if(playerid == id) return SendClientMessage(playerid, red,"ERROR: {FFFFFF} You cannot pm yourself!");
   
    GetPlayerName(playerid, Name1, sizeof(Name1));
    GetPlayerName(id, Name2, sizeof(Name2));
    format(str, sizeof(str), "PM To %s [ID %d]: %s", Name2, id, msg);
    SendClientMessage(playerid, yellow, str);
    format(str, sizeof(str), "PM From %s [ID %d]: %s", Name1, playerid, msg);
    SendClientMessage(id, yellow, str);
        return 1;
}
EDIT: Whoops, thanks BroZeus
Reply


Messages In This Thread
Need help about chat - by iThePunisher - 29.03.2014, 10:13
Re : Need help about chat - by samp_boy - 29.03.2014, 10:22
Re: Need help about chat - by BroZeus - 29.03.2014, 10:24
Re: Need help about chat - by EiresJason - 29.03.2014, 10:25
Re: Need help about chat - by iThePunisher - 29.03.2014, 10:27
Re: Need help about chat - by BroZeus - 29.03.2014, 10:39
Re: Need help about chat - by EiresJason - 29.03.2014, 10:42
Re: Need help about chat - by BroZeus - 29.03.2014, 10:45
Re: Need help about chat - by iThePunisher - 29.03.2014, 10:51

Forum Jump:


Users browsing this thread: 3 Guest(s)