23.07.2011, 22:21
Hello, I need a PM command in dcmd please aswell as sscanf
Thanks
Thanks
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;
}
But what if his gamemode is already in DCMD? Why not just keep using DCMD and SSCANF?
|