31.05.2009, 01:38
[color=brown]Hello. I have a new error, this time I cannot figure out what to do for my function, to give out the Value inside of the String.
Example:
The text of the string comes up, just not the %s part.
Here's my code, help me to get it like Above ^
Example:
Quote:
|
Hello, my name is bob. I am [Function Value Here] Years old. |
Here's my code, help me to get it like Above ^
Код:
public OnPlayerCommandText(playerid, cmdtext[]) {
dcmd(checksober, 10, cmdtext);
return 0;
}
dcmd_checksober(playerid, params[])
{
new
id,
abc[64];
if (strlen(params))
{
id = strval(params);
if (IsPlayerConnected(id))
{
GetPlayerDrunkTime(id);
format(abc, sizeof (abc), "The Player's Drunk Level is %s.");
SendClientMessage(id, 0x00FF00AA, "You have been tested for your Soberness");
SendClientMessage(playerid, 0x00FF00AA, abc);
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "Player not found");
}
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/checksober <playerid>\"");
}
return 1;
}

