01.11.2010, 10:45
No, i don't created it like that.So what I created until now is this:
But the problem is that I want to know how to write code, which will let policeman to write amount of money in the /command [playername] [HERE]...So for this I used function SetInt, but is it right?That's my question.And still no one didn't tell me how to do, that strtok function search what policeman writed /command here HERE?
pawn Код:
new tmp, name, Float:x, Float:y, Float:z, policeman, string, money;
if(strcmp(cmdtext, "/penalty", true) == 0)
{
tmp = strval(GetPlayerName(playerid, name, sizeof(name));
money = strval(SetInt(playerid));
tmp = strtok(cmdtex, idx);
if(strlen(tmp) == 0) return SendClientMessage(playerid, 0xAFAFAFAA, "Usage: /penalty [Player_Nick]");
if(!IsPlayerInRangeOfPoint(playerid, 7.0, x, y, z))
{
SendClientMessage(playerid, 0xAFAFAFAA, "He's running!")
}
else
{
GetPlayerName(playerid, policeman, sizeof(policeman));
format(string, sizeof(string), "You was stopped by %s.He requiring to you to pay %d for penalty ", policeman, money));
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSBOX, "PENALTY", "string", "Accept", "Disagree");