61
mIRC/pawn Scripting / Tax Command
« on: July 23, 2011, 01:05:10 pm »
I wanted to make a tax command but theirs some problems with it, I dont know what to add in the script or delete. I want to make it so when I or any other admin taxes someone it takes peoples money and sends it to us. This is what I done so far.
And another tax was /c btax so it taxes someone from their bank.
I need help because when I tax myself it takes all my money. I want it so I can /c tax (Id) (amount)
The bank tax kind of works but it still takes all my money in my bank. Can someone help please?
P.S. I know u have to add something where it says tmp=(what ever) but I dont know what to add because I know tmp is the one where u can make commands like say /c drown the command has to be /c drown (id) (reason) if the tmp is changed it can just make it /c drown (id) without the reason.
Quote
}
else if (strcmp(cmd, "tax", true) == 0) {
new szMsg[256], plr;
tmp = strtok(cmdtext, idx), plr = FindPlayerIDFromString(tmp);
if(PlayerInfo[playerid][Logged] != 1) SendClientMessage(playerid, COLOR_RED, "You need to login first!");
else if(!IsPlayerCommandLevel(playerid,"jail")) SendClientMessage(playerid, COLOR_RED, "You don't have access to use this command!");
else if (!strlen(tmp)) SendClientMessage(playerid,COLOR_RED,"USAGE: /c tax [Nick/ID]");
else if (plr == INACTIVE_PLAYER_ID) SendClientMessage(playerid,COLOR_RED,"Error: Unknown player");
else {
format(szMsg,sizeof(szMsg),"%s has taxed %s for $%d dollars",gPlayers[playerid],gPlayers[plr], GetPlayerHandCash(gPlayers[playerid]));
SendClientMessageToAll(COLOR_YELLOW,szMsg);
DecPlayerHandCash(playerid,GetPlayerHandCash(gPlayers[playerid]));
}
return 1;
And another tax was /c btax so it taxes someone from their bank.
Quote
}
else if (strcmp(cmd, "btax", true) == 0) {
new szMsg[256], plr;
tmp = strtok(cmdtext, idx), plr = FindPlayerIDFromString(tmp);
if(PlayerInfo[playerid][Logged] != 1) SendClientMessage(playerid, COLOR_RED, "You need to login first!");
else if(!IsPlayerCommandLevel(playerid,"jail")) SendClientMessage(playerid, COLOR_RED, "You don't have access to use this command!");
else if (!strlen(tmp)) SendClientMessage(playerid,COLOR_RED,"USAGE: /c btax [Nick/ID]");
else if (plr == INACTIVE_PLAYER_ID) SendClientMessage(playerid,COLOR_RED,"Error: Unknown player");
else {
format(szMsg,sizeof(szMsg),"%s has bank taxed %s for $%d dollars",gPlayers[playerid],gPlayers[plr], GetPlayerHandCash(gPlayers[playerid]));
SendClientMessageToAll(COLOR_YELLOW,szMsg);
DecPlayerBankCash(playerid,GetPlayerBankCash(gPlayers[playerid]));
}
return 1;
I need help because when I tax myself it takes all my money. I want it so I can /c tax (Id) (amount)
The bank tax kind of works but it still takes all my money in my bank. Can someone help please?
P.S. I know u have to add something where it says tmp=(what ever) but I dont know what to add because I know tmp is the one where u can make commands like say /c drown the command has to be /c drown (id) (reason) if the tmp is changed it can just make it /c drown (id) without the reason.