26.07.2011, 04:11
pawn Код:
COMMAND:transfer(playerid, params[])
{
new transfer;
new id;
new file[100],Name[MAX_PLAYER_NAME]; GetPlayerName(playerid,Name,sizeof(Name)); format(file,sizeof(file),PlayerFile,Name);
if(!IsPlayerInRangeOfPoint(playerid,20.0,2313,-4, 27) || !IsPlayerInRangeOfPoint(playerid, 20.0, 1432.9182,-997.8287,1639.7911)) return SendClientMessage(playerid,COLOR_RED,"You have to be in Bank");
else if(sscanf(params,"ud",id, transfer)) return SendClientMessage(playerid,COLOR_WHITE,"USAGE:/transfer [id] [Amount]");
else if(transfer > pInfo[playerid][Deposit]) return SendClientMessage(playerid,COLOR_RED,"You Don't Have That Amount In Bank To Transfer");
{
}
pInfo[playerid][Deposit] -= transfer;
pInfo[id][Deposit] += transfer;
SendClientMessage(playerid,COLOR_GREEN,"BANK");
new string[128]; format(string,sizeof(string),"You Transfered %d$ To %d's Bank Account",transfer,Name[id]);
SendClientMessage(playerid,COLOR_TAN,string);
dini_IntSet(file,"Deposit",pInfo[playerid][Deposit]);
new string2[128]; format(string2,128,"Your New Balance Is : %d$",pInfo[playerid][Deposit]);
SendClientMessage(playerid,COLOR_TAN,string2);
SendClientMessage(id,COLOR_GREEN,"BANK");
new string3[128]; format(string3,128,"%d has transfered %d$ To Your Bank Account",Name[playerid],transfer);
SendClientMessage(id,COLOR_TAN,string3);
new string4[128]; format(string4,128,"Your New Balance : %d$",pInfo[id][Deposit]);
SendClientMessage(id,COLOR_TAN,string4);
return 1;
}