10.09.2009, 04:51
i need help to make a commands with multiple parameters i tried with the wiki but it don't explain with multiple parameters
help please
thanks
help please
thanks
dcmd_pm(playerid, params[])
{
new otherid, result[256], string[256];
if(sscanf(params, "us", otherid, result) SendClientMessage(playerid, RED, "Usage: /PM [ID] [MSG]");
// The "us" part is the format of the input. u is for username or playerid and s is for string which is the message.
else
{
format(string, sizeof(string), "PM(%d): %s", playerid, result);
SendClientMessage(otherid, YELLOW, string);
}
return 1;
}
dcmd_pm(playerid, params[])
{
new otherid, result[100], string[128];
if(sscanf(params, "us", otherid, result) SendClientMessage(playerid, RED, "Usage: /PM [ID] [MSG]");
else if(otherid == INVALID_PLAYER_ID) SendClientMessage(playerid, RED, "Error: Player not found.");
else
{
format(string, sizeof(string), "PM(%d): %s", playerid, result);
SendClientMessage(otherid, YELLOW, string);
SendClientMessage(playerid, YELLOW, string);
}
return 1;
}