help please -
Rapk1d - 03.10.2012
How can i make to show to admins when someone use /transfer
and when they use /pay above 50k
Please help
AW: help please -
BiosMarcel - 03.10.2012
Write your command and we can edit the cmd
Re: help please -
Rapk1d - 03.10.2012
////////////////// ATM TRANSFER
if(strcmp(cmd, "/atmtransfer", true) == 0 || strcmp(cmd, "/atmwiretransfer", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pLevel] < 3)
{
SendClientMessage(playerid, COLOR_GRAD1, " You must be level 3 !");
return 1;
}
if(PlayerToPoint(25.0,playerid,-1981.71,120.82,27.67))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "{D580FE}Foloseste:{FFFFFF} /atmtransfer [playerid/PartOfName] [amount]");
return 1;
}
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "{D580FE}Foloseste:{FFFFFF} /atmtransfer [playerid/PartOfName] [amount] [reason]");
return 1;
}
moneys = strval(tmp);
if (IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
playermoney = PlayerInfo[playerid][pAccount] ;
new length = strlen(cmdtext); //adaugat
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "{D580FE}Foloseste:{FFFFFF} /atmtransfer [playerid/PartOfName] [amount] [reason]");
return 1;
}//aici
if (moneys > 0 && playermoney >= moneys)
{
format(string, sizeof(string),"%s wants to transfer you %d$ reason: %s, if you want to accept the money, type /accept money.",sendername,moneys,(result));
SendClientMessage(giveplayerid, COLOR_LIGHTRED, string);
format(string, sizeof(string),"You have offered %s to accept %d$ reason: %s.Wait his answer.",giveplayer,moneys,(result));
SendClientMessage(playerid, COLOR_LIGHTRED, string);
TransferOffer[giveplayerid] = playerid;
TransferMoney[giveplayerid] = moneys;
format(string, sizeof(string), "%s transferd $%d to %s reason: %s", sendername, moneys, giveplayer, (result));
if(moneys >= 500000)
{
ABroadCast(COLOR_YELLOW,string,1);
}
//printf("%s", string);//aici
PayLog(string);
PlayerPlaySound(giveplayerid, 1052, 0.0, 0.0, 0.0);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Invalid transaction amount.");
}
}
}
else
{
format(string, sizeof(string), " %d nu este un player activ.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}
}
//////////////////////////////// TRANSFER
if(strcmp(cmd, "/transfer", true) == 0 || strcmp(cmd, "/wiretransfer", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pLevel] < 3)
{
SendClientMessage(playerid, COLOR_GRAD1, " You must be level 3 !");
return 1;
}
if(PlayerInfo[playerid][pLocal] != 103)
{
SendClientMessage(playerid, COLOR_GREY, " You are not at the Bank !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "{D580FE}Foloseste:{FFFFFF} /transfer [playerid/PartOfName] [amount] [reason]");
return 1;
}
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "{D580FE}Foloseste:{FFFFFF} /transfer [playerid/PartOfName] [amount] [reason]");
return 1;
}
moneys = strval(tmp);
if (IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
/*if(PlayerInfo[giveplayerid][pLevel] <= 5)
{
SendClientMessage(playerid, COLOR_WHITE, " You can`t give money to newbies !");
return 1;
}*/
new length = strlen(cmdtext);//adaugat
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "{D580FE}Foloseste:{FFFFFF} /transfer [playerid/PartOfName] [amount] [reason]");
return 1;
}//aici
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
playermoney = PlayerInfo[playerid][pAccount] ;
if (moneys > 0 && playermoney >= moneys)
{
format(string, sizeof(string),"%s wants to transfer you %d$ reason: %s, if you want to accept the money, type /accept money.",sendername,moneys,(result));
SendClientMessage(giveplayerid, COLOR_LIGHTRED, string);
format(string, sizeof(string),"You have offered %s to accept %d$ reason: %s.Wait his answer.",giveplayer,moneys,(result));
SendClientMessage(playerid, COLOR_LIGHTRED, string);
TransferOffer[giveplayerid] = playerid;
TransferMoney[giveplayerid] = moneys;
format(string, sizeof(string), "%s transferd $%d to %s reason: %s", sendername, moneys, giveplayer, (result));
if(moneys >= 500000)
{
ABroadCast(COLOR_YELLOW,string,1);
}
//printf("%s", string);//aici
PayLog(string);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Invalid transaction amount.");
}
}
}
else
{
format(string, sizeof(string), " %d is not an active player.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}
///////////////////////////////////////
//-------------------------------[Pay]--------------------------------------------------------------------------
if(strcmp(cmd, "/pay", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pLevel] <= 1)
{
SendClientMessage(playerid, COLOR_WHITE, " You must be level 2 !");
return 1;
}
if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, " You can't use this command, you have been silenced !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "{D580FE}Foloseste:{FFFFFF} /pay [playerid/PartOfName] [amount] [reason]");
return 1;
}
//giveplayerid = strval(tmp);
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "{D580FE}Foloseste:{FFFFFF} /pay [playerid/PartOfName] [amount] [reason]");
return 1;
}
moneys = strval(tmp);
if(moneys > 1000 && PlayerInfo[playerid][pLevel] < 3)
{
SendClientMessage(playerid, COLOR_GRAD1, "You must be level 3 to pay over 1000");
return 1;
}
if(moneys < 1 || moneys > 99999)
{
SendClientMessage(playerid, COLOR_GRAD1, "Dont go below 1, or above 99999 at once.");
return 1;
}
if (IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(PlayerInfo[giveplayerid][pLocal] == 106)
{
SendClientMessage(playerid, COLOR_GRAD1, "Command not allowed in this location");
return 1;
}
if(PlayerInfo[giveplayerid][pLevel] <= 3)
{
SendClientMessage(playerid, COLOR_WHITE, " You can`t give money to newbies (use /transfer)!");
return 1;
}
/*if(PlayerInfo[giveplayerid][pJob] == 2)
{
SendClientMessage(playerid, COLOR_WHITE, " You can pay this lawyer with maximum 30000$ !");
return 1;
}*/
if (ProxDetectorS(5.0, playerid, giveplayerid))
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
playermoney = GetPlayerMoney(playerid);
new length = strlen(cmdtext); //adaugat
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "{D580FE}Foloseste:{FFFFFF} /pay [playerid/PartOfName] [amount] [reason]");
return 1;
}//aici
if (moneys > 0 && playermoney >= moneys)
{
ConsumingMoney[giveplayerid] = 1;
GivePlayerMoney(playerid, (0 - moneys));
GivePlayerMoney(giveplayerid, moneys);
format(string, sizeof(string), " You have sent %s(player: %d), $%d.", giveplayer,giveplayerid, moneys);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
SendClientMessage(playerid, COLOR_GRAD1, string);
format(string, sizeof(string), " You have recieved $%d from %s(player: %d) reason: %s.", moneys, sendername, playerid, (result));
SendClientMessage(giveplayerid, COLOR_GRAD1, string);
format(string, sizeof(string), "%s has paid $%d to %s reason: %s", sendername, moneys, giveplayer, (result));
PayLog(string);
if(moneys >= 1000000)
{
ABroadCast(COLOR_YELLOW,string,1);
}
PlayerPlaySound(giveplayerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "* %s takes out some cash, and hands it to %s.", sendername ,giveplayer);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Invalid transaction amount.");
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Your too far away.");
}
}//invalid id
}
else
{
format(string, sizeof(string), " %d is not an active player.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}
AW: help please -
BiosMarcel - 03.10.2012
please write it in a code box
Re: help please -
Rapk1d - 03.10.2012
done
Код:
////////////////// ATM TRANSFER
if(strcmp(cmd, "/atmtransfer", true) == 0 || strcmp(cmd, "/atmwiretransfer", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pLevel] < 3)
{
SendClientMessage(playerid, COLOR_GRAD1, " You must be level 3 !");
return 1;
}
if(PlayerToPoint(25.0,playerid,-1981.71,120.82,27.67))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "{D580FE}Foloseste:{FFFFFF} /atmtransfer [playerid/PartOfName] [amount]");
return 1;
}
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "{D580FE}Foloseste:{FFFFFF} /atmtransfer [playerid/PartOfName] [amount] [reason]");
return 1;
}
moneys = strval(tmp);
if (IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
playermoney = PlayerInfo[playerid][pAccount] ;
new length = strlen(cmdtext); //adaugat
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "{D580FE}Foloseste:{FFFFFF} /atmtransfer [playerid/PartOfName] [amount] [reason]");
return 1;
}//aici
if (moneys > 0 && playermoney >= moneys)
{
format(string, sizeof(string),"%s wants to transfer you %d$ reason: %s, if you want to accept the money, type /accept money.",sendername,moneys,(result));
SendClientMessage(giveplayerid, COLOR_LIGHTRED, string);
format(string, sizeof(string),"You have offered %s to accept %d$ reason: %s.Wait his answer.",giveplayer,moneys,(result));
SendClientMessage(playerid, COLOR_LIGHTRED, string);
TransferOffer[giveplayerid] = playerid;
TransferMoney[giveplayerid] = moneys;
format(string, sizeof(string), "%s transferd $%d to %s reason: %s", sendername, moneys, giveplayer, (result));
if(moneys >= 500000)
{
ABroadCast(COLOR_YELLOW,string,1);
}
//printf("%s", string);//aici
PayLog(string);
PlayerPlaySound(giveplayerid, 1052, 0.0, 0.0, 0.0);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Invalid transaction amount.");
}
}
}
else
{
format(string, sizeof(string), " %d nu este un player activ.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}
}
//////////////////////////////// TRANSFER
if(strcmp(cmd, "/transfer", true) == 0 || strcmp(cmd, "/wiretransfer", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pLevel] < 3)
{
SendClientMessage(playerid, COLOR_GRAD1, " You must be level 3 !");
return 1;
}
if(PlayerInfo[playerid][pLocal] != 103)
{
SendClientMessage(playerid, COLOR_GREY, " You are not at the Bank !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "{D580FE}Foloseste:{FFFFFF} /transfer [playerid/PartOfName] [amount] [reason]");
return 1;
}
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "{D580FE}Foloseste:{FFFFFF} /transfer [playerid/PartOfName] [amount] [reason]");
return 1;
}
moneys = strval(tmp);
if (IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
/*if(PlayerInfo[giveplayerid][pLevel] <= 5)
{
SendClientMessage(playerid, COLOR_WHITE, " You can`t give money to newbies !");
return 1;
}*/
new length = strlen(cmdtext);//adaugat
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "{D580FE}Foloseste:{FFFFFF} /transfer [playerid/PartOfName] [amount] [reason]");
return 1;
}//aici
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
playermoney = PlayerInfo[playerid][pAccount] ;
if (moneys > 0 && playermoney >= moneys)
{
format(string, sizeof(string),"%s wants to transfer you %d$ reason: %s, if you want to accept the money, type /accept money.",sendername,moneys,(result));
SendClientMessage(giveplayerid, COLOR_LIGHTRED, string);
format(string, sizeof(string),"You have offered %s to accept %d$ reason: %s.Wait his answer.",giveplayer,moneys,(result));
SendClientMessage(playerid, COLOR_LIGHTRED, string);
TransferOffer[giveplayerid] = playerid;
TransferMoney[giveplayerid] = moneys;
format(string, sizeof(string), "%s transferd $%d to %s reason: %s", sendername, moneys, giveplayer, (result));
if(moneys >= 500000)
{
ABroadCast(COLOR_YELLOW,string,1);
}
//printf("%s", string);//aici
PayLog(string);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Invalid transaction amount.");
}
}
}
else
{
format(string, sizeof(string), " %d is not an active player.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}
///////////////////////////////////////
//-------------------------------[Pay]--------------------------------------------------------------------------
if(strcmp(cmd, "/pay", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pLevel] <= 1)
{
SendClientMessage(playerid, COLOR_WHITE, " You must be level 2 !");
return 1;
}
if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, " You can't use this command, you have been silenced !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "{D580FE}Foloseste:{FFFFFF} /pay [playerid/PartOfName] [amount] [reason]");
return 1;
}
//giveplayerid = strval(tmp);
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "{D580FE}Foloseste:{FFFFFF} /pay [playerid/PartOfName] [amount] [reason]");
return 1;
}
moneys = strval(tmp);
if(moneys > 1000 && PlayerInfo[playerid][pLevel] < 3)
{
SendClientMessage(playerid, COLOR_GRAD1, "You must be level 3 to pay over 1000");
return 1;
}
if(moneys < 1 || moneys > 99999)
{
SendClientMessage(playerid, COLOR_GRAD1, "Dont go below 1, or above 99999 at once.");
return 1;
}
if (IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(PlayerInfo[giveplayerid][pLocal] == 106)
{
SendClientMessage(playerid, COLOR_GRAD1, "Command not allowed in this location");
return 1;
}
if(PlayerInfo[giveplayerid][pLevel] <= 3)
{
SendClientMessage(playerid, COLOR_WHITE, " You can`t give money to newbies (use /transfer)!");
return 1;
}
/*if(PlayerInfo[giveplayerid][pJob] == 2)
{
SendClientMessage(playerid, COLOR_WHITE, " You can pay this lawyer with maximum 30000$ !");
return 1;
}*/
if (ProxDetectorS(5.0, playerid, giveplayerid))
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
playermoney = GetPlayerMoney(playerid);
new length = strlen(cmdtext); //adaugat
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "{D580FE}Foloseste:{FFFFFF} /pay [playerid/PartOfName] [amount] [reason]");
return 1;
}//aici
if (moneys > 0 && playermoney >= moneys)
{
ConsumingMoney[giveplayerid] = 1;
GivePlayerMoney(playerid, (0 - moneys));
GivePlayerMoney(giveplayerid, moneys);
format(string, sizeof(string), " You have sent %s(player: %d), $%d.", giveplayer,giveplayerid, moneys);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
SendClientMessage(playerid, COLOR_GRAD1, string);
format(string, sizeof(string), " You have recieved $%d from %s(player: %d) reason: %s.", moneys, sendername, playerid, (result));
SendClientMessage(giveplayerid, COLOR_GRAD1, string);
format(string, sizeof(string), "%s has paid $%d to %s reason: %s", sendername, moneys, giveplayer, (result));
PayLog(string);
if(moneys >= 1000000)
{
ABroadCast(COLOR_YELLOW,string,1);
}
PlayerPlaySound(giveplayerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "* %s takes out some cash, and hands it to %s.", sendername ,giveplayer);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Invalid transaction amount.");
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Your too far away.");
}
}//invalid id
}
else
{
format(string, sizeof(string), " %d is not an active player.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}