Vice City Multiplayer
VC:MP 0.3 => mIRC/pawn Scripting => Topic started by: kitt85711 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.
}
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.
}
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? :D
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.
-
(http://tigerlilytoph.files.wordpress.com/2011/07/facepalm-3.jpg)
* heekz.shadow triple facepalms.
DecPlayerHandCash(playerid,GetPlayerHandCash(gPlayers[playerid]));
Are you sure?
Did you ever noticed you delete all his cash?
Look at "setgravity" command in gups and you take the value sistem..
Look..
You need to define the value.. /c tax [NICK/ID][VALUE]
There must be something like this in gups and I'm sure there is. Too lazy to check because I'm not at my home :P
-
Lmao Shadow.. Don't Treat newbies like that once all were like that
@Kittrell
Hand cash Tax:
[pawn]}
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 ( !IsNumeric( tmp ) ) SendClientMessage( playerid, COLOR_YELLOW, "Error: Amount Should be Number!" );
else if(!IsPlayerCommandLevel(playerid,"tax")) 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] [Amount]");
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], tmp);
SendClientMessageToAll(COLOR_YELLOW,szMsg);
DecPlayerHandCash(playerid,tmp);
}
return 1;
}[/pawn]
Bank Tax Command
[pawn] 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 ( !IsNumeric( tmp ) ) SendClientMessage( playerid, COLOR_YELLOW, "Error: Amount Should be Number!" );
else if(!IsPlayerCommandLevel(playerid,"tax")) 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] [Amount]");
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], tmp);
SendClientMessageToAll(COLOR_YELLOW,szMsg);
DecPlayerBankCash(playerid,tmp);
}
return 1;
}[/pawn]
Havent Tested but im pretty sure it works.. so, be sure you backup your scripts before your add it to your script
Hope it helps and enjoy 8)
-
Err.. ?? How did I made him feel bad? Facepalming myself?
-
Thanks yazeen, shadow lol you may think I failed but at lease I tried on my own I knew it couldn't be a "plr"