zcmd and sscanf problem
#7

Ok Sky, since he said he is using sscanf2, your strings will be deprecated since you aren't assigning a size

pawn Код:
CMD:pm(playerid, params[])
{
    new ID, Message[128];
    if(sscanf(params, "us[128]", ID, params)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /PM < Player ID > < Message >");
    if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, COLOR_RED, "ERROR: That user is offline!");
    format(Message, sizeof(Message), "PM From %s: %s", pName(playerid), params);
    SendClientMessage(playerid, GREEN, Message);
    format(Message, sizeof(Message), "PM To %s: %s", pName(ID), params);
    SendClientMessage(playerid, GREEN, Message);
    return 1;
}
Remeber that you will need to get the player's name, not sure if you use pName since thats the popular stock to use. But you can still use, GetPlayerName. Up to you, modify it to fit your needs.
Reply


Messages In This Thread
zcmd and sscanf problem - by mrcoolballs - 23.08.2010, 21:24
Re: zcmd and sscanf problem - by nemesis- - 23.08.2010, 21:31
Re: zcmd and sscanf problem - by mrcoolballs - 23.08.2010, 21:32
Re: zcmd and sscanf problem - by nemesis- - 23.08.2010, 21:35
Re: zcmd and sscanf problem - by Sky4D - 23.08.2010, 21:37
Re: zcmd and sscanf problem - by FreshKilla - 23.08.2010, 21:40
Re: zcmd and sscanf problem - by [L3th4l] - 23.08.2010, 21:43
Re: zcmd and sscanf problem - by mrcoolballs - 23.08.2010, 21:45
Re: zcmd and sscanf problem - by nemesis- - 23.08.2010, 22:08
Re: zcmd and sscanf problem - by Sky4D - 23.08.2010, 22:10

Forum Jump:


Users browsing this thread: 2 Guest(s)