30.07.2012, 18:29
something like this?
pawn Код:
new CanAcceptMoney[MAX_PLAYERS];
new MoneyAmount[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
CanAcceptMoney[playerid] = 0;
MoneyAmount[playerid] = 0;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/givemoney") == 0)
{
new targetid = strval(GetToken(cmdtext, 1)); // your thing to get player id
new money = strval(GetToken(cmdtext, 2)); // your thing to get amount of money
if(IsPlayerConnected(targetid))
{
CanAcceptMoney[targetid] = 1;
MoneyAmount[targetid] = money;
SendClientMessage(targetid, -1, "Someone is sending you money! Type /acceptmoney to accept the money");
return 1;
}
}
if(strcmp(cmdtext, "/acceptmoney") == 0)
{
if(CanAcceptMoney[playerid] == 1)
{
GivePlayerMoney(playerid, MoneyAmoun[playerid]);
CanAcceptMoney[playerid] = 0;
return 1;
}
}
return 0;
}