zcmd /pm help
#2

pawn Код:
COMMAND:pm(playerid, params[])
{
    new str[128], str2[128], id, Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME];
    if(sscanf(params, "ds[128]", id, str2)) return SendClientMessage(playerid, ADMINFS_MESSAGE_COLOR, "Usage: /pm (id) (message)");
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid, ADMINFS_MESSAGE_COLOR, "/pm : Bad player ID");
    if(playerid == id) return SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR, "You cannot PM yourself");
    {
        GetPlayerName(playerid, Name1, sizeof(Name1));
        GetPlayerName(id, Name2, sizeof(Name2));
        format(str, sizeof(str), ">> %s(%d): %s", Name2, id, str2);
        SendClientMessage(playerid, PM_OUTGOING_COLOR, str);
        format(str, sizeof(str), "** %s(%d): %s", Name1, playerid, str2);
        SendClientMessage(id, PM_INCOMING_COLOR, str);
        PlayerPlaySound(id,1085,0.0,0.0,0.0);
        printf("PM: %s",str2);
    }
    return 1;
}
Try this with sscanf
Reply


Messages In This Thread
zcmd /pm help - by ricardo178 - 12.03.2011, 19:40
Re: zcmd /pm help - by xir - 12.03.2011, 19:47
Re: zcmd /pm help - by iMonk3y - 12.03.2011, 19:49
Re: zcmd /pm help - by Scrip - 12.03.2011, 19:55
Re: zcmd /pm help - by ricardo178 - 12.03.2011, 20:24

Forum Jump:


Users browsing this thread: 1 Guest(s)