PM command in dcmd+sscanf
#1

Hello, I need a PM command in dcmd please aswell as sscanf

Thanks
Reply
#2

pawn Код:
dcmd_pm(playerid, params[])
{
    new target, msg[128], tmp[128], name[MAX_PLAYER_NAME];
    if(sscanf(params, "us[128]", target, msg)) return SendClientMessage(playerid, -1, "Syntax: /pm id msg");
    if(!IsPlayerConnected(target)) return SendClientMessage(playerid, -1, "That player is offline!");
    GetPlayerName(playerid, name, sizeof(name)); //Might be sizeof(name) before the "name" cant look at wiki atm
    format(tmp, sizeof(tmp), "[PM] %s says: %s", name, msg);
    SendClientMessage(target, -1, tmp);
    return 1;
}
Untested but should work
Reply
#3

Yes, should work. But i suggest you to use ZCMD or YCMD most used and much faster. At the moment YCMD is faster than all.
Reply
#4

Quote:
Originally Posted by Anthony_prince
Посмотреть сообщение
Yes, should work. But i suggest you to use ZCMD or YCMD most used and much faster. At the moment YCMD is faster than all.
But what if his gamemode is already in DCMD? Why not just keep using DCMD and SSCANF?
Reply
#5

Quote:
Originally Posted by Steven82
Посмотреть сообщение
But what if his gamemode is already in DCMD? Why not just keep using DCMD and SSCANF?
Because it's really easy to switch to ZCMD.
Reply
#6

Quote:
Originally Posted by Steven82
Посмотреть сообщение
But what if his gamemode is already in DCMD? Why not just keep using DCMD and SSCANF?
And if someone want to buid a nice GM even editied is better to have more speed and less lag. What do you think?

Quote:
Originally Posted by Mean
Посмотреть сообщение
Because it's really easy to switch to ZCMD.
Agree.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)