03.09.2009, 05:08
It works, i tried doing what you were doing but got mad at strcmp so I just used DCMD..
with that you can do /drink number and it will set your drunk level to the number
so /drink 3000
pawn Код:
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
//-------------------------------------------------
dcmd_drink(playerid, params[])
{
if(!strlen(params)) return SendClientMessage(playerid, 0xFFFFFFAA, "Error: You did not submit a number.");
SetPlayerDrunkLevel(playerid, strval(params));
SendClientMessage(playerid, 0xFFFFFFAA, "You are now drunk, don't drink and drive!");
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(drink,5,cmdtext);
}
with that you can do /drink number and it will set your drunk level to the number
so /drink 3000