rendered paste bodypublic OnPlayerCommandText(playerid, cmdtext[])
{
new string[256];
new playermoney;
new sendername[MAX_PLAYER_NAME];
new giveplayer[MAX_PLAYER_NAME];
new cmd[256];
new giveplayerid, moneys, idx;
new VehicleID = GetPlayerVehicleID(playerid);
new Float:x, Float:y, Float:z, Float:ang;
new InVehicle = IsPlayerInAnyVehicle(playerid);
new IsAdmin = IsPlayerAdmin(playerid);
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, "/help", true) == 0)
{
SendPlayerFormattedText(playerid,"Las Venturas Deathmatch: Money Grub Coded By Jax and the SA-MP Team.",0);
SendPlayerFormattedText(playerid,"Type: /objective : to find out what to do in this gamemode.",0);
SendPlayerFormattedText(playerid,"Type: /givecash [playerid] [money-amount] to send money to other players.",0);
SendPlayerFormattedText(playerid,"Type: /admincmd : to see a list of admin commands.",0);
SendPlayerFormattedText(playerid,"Type: /commands : to see a list of commands.",0);
return 1;
}
if(strcmp(cmd, "/objective", true) == 0) {
SendPlayerFormattedText(playerid,"This gamemode is faily open, there's no specific win / endgame conditions to meet.",0);
SendPlayerFormattedText(playerid,"In LVDM:Money Grub, when you kill a player, you will receive whatever money they have.",0);
SendPlayerFormattedText(playerid,"Consequently, if you have lots of money, and you die, your killer gets your cash.",0);
SendPlayerFormattedText(playerid,"However, you're not forced to kill players for money, you can always gamble in the", 0);
SendPlayerFormattedText(playerid,"Casino's.", 0);
return 1;
}
if(strcmp(cmd, "/tips", true) == 0)
{
SendPlayerFormattedText(playerid,"Spawning with just a desert eagle might sound lame, however the idea of this",0);
SendPlayerFormattedText(playerid,"gamemode is to get some cash, get better guns, then go after whoever has the",0);
SendPlayerFormattedText(playerid,"most cash. Once you've got the most cash, the idea is to stay alive(with the",0);
SendPlayerFormattedText(playerid,"cash intact)until the game ends, simple right ?",0);
return 1;
}
if(strcmp(cmd, "/commands", true) == 0)
{
SendClientMessage(playerid, COLOR_GREEN,"Car commands : /flip, /lock, /unlock, /taxi, /iamtaxi, /intaxi, /carcolor [color1] [color2].");
SendClientMessage(playerid, COLOR_GREEN,"Teleports : /drift, /spawn, /wang, /grovest, /skatepark.");
SendClientMessage(playerid, COLOR_GREEN,"Others : /clearchat, /splat, /me, /away, /back, /score, /wtf?.");
return 1;
}
if(strcmp(cmd, "/admincmd", true) == 0)
{
if(IsAdmin == 1)
{
SendClientMessage(playerid, COLOR_GREEN,"Commands : /godmode, /nogodmode, /day, /night, /clearall, /repair.");
SendClientMessage(playerid, COLOR_YELLOW,"For weapons type : /weapon [playerid] [weaponid] [ammo]");
SendClientMessage(playerid, COLOR_YELLOW,"For cars type : /vehicle [playerid] [vehicleid]");
SendClientMessage(playerid, COLOR_YELLOW,"To get a player cash type : /sendcash [playerid] [amount]");
SendClientMessage(playerid, COLOR_YELLOW,"For car components type : /component [playerid] [componentid]");
SendClientMessage(playerid, COLOR_YELLOW,"Very secret: /getpos [playerid]");
SendClientMessage(playerid, COLOR_YELLOW,"This is a command to set playerpos: /coord [Float:x] [Float:y] [Float:z]");
}
else
{
SendClientMessage(playerid, COLOR_RED, "You are not an admin!");
}
return 1;
}
if(strcmp(cmd, "/clearall", true) == 0)
{
SendClientMessageToAll(COLOR_WHITE, " ");
SendClientMessageToAll(COLOR_WHITE, " ");
SendClientMessageToAll(COLOR_WHITE, " ");
SendClientMessageToAll(COLOR_WHITE, " ");
SendClientMessageToAll(COLOR_WHITE, " ");
SendClientMessageToAll(COLOR_WHITE, " ");
SendClientMessageToAll(COLOR_WHITE, " ");
SendClientMessageToAll(COLOR_WHITE, " ");
SendClientMessageToAll(COLOR_WHITE, " ");
SendClientMessageToAll(COLOR_WHITE, " ");
return 1;
}
if(strcmp(cmd, "/clearchat", true) == 0)
{
SendClientMessage(playerid, COLOR_WHITE, " ");
SendClientMessage(playerid, COLOR_WHITE, " ");
SendClientMessage(playerid, COLOR_WHITE, " ");
SendClientMessage(playerid, COLOR_WHITE, " ");
SendClientMessage(playerid, COLOR_WHITE, " ");
SendClientMessage(playerid, COLOR_WHITE, " ");
SendClientMessage(playerid, COLOR_WHITE, " ");
SendClientMessage(playerid, COLOR_WHITE, " ");
SendClientMessage(playerid, COLOR_WHITE, " ");
SendClientMessage(playerid, COLOR_WHITE, " ");
return 1;
}
if(strcmp(cmd, "/score", true) == 0)
{
new str[256];
GetPlayerName(playerid, str, sizeof (str));
new score = GetPlayerScore(playerid);
format(str, sizeof (str), "%s has $%d.", str, score);
SendClientMessageToAll(COLOR_YELLOW, str);
return 1;
}
if(strcmp(cmd, "/splat", true) == 0)
{
if(InVehicle == 1)
{
SendClientMessage(playerid, COLOR_RED, "You cant be in any vehicle!");
}
else
{
GetPlayerPos(playerid, x,y,z);
SetPlayerPos(playerid, x,y,z+200);
GameTextForPlayer(playerid, "~g~You are going to ~r~DIIIEEE!!!!!", 5000, 5);
}
return 1;
}
if(strcmp(cmd, "/me", true, 3) == 0)
{
new str[256];
new pname[256];
GetPlayerName(playerid, pname, 256);
format(str, 256, "%s %s", pname, cmdtext[4]);
SendClientMessageToAll(COLOR_LIGHTBLUE, str);
return 1;
}
if(strcmp(cmd, "/wtf?", true) == 0)
{
new str[256];
GetPlayerName(playerid, str, sizeof (str));
format(str, sizeof (str), "%s: WTF OMG LOL DAMN SHIT STFU N00BS", str);
SendClientMessageToAll(COLOR_RED, str);
GameTextForAll("~r~WTF OMG LOL DAMN SHIT STFU N00BS!!", 50000, 5);
return 1;
}
if(strcmp(cmd, "/gmx", true) == 0)
{
if(IsAdmin == 1)
{
SendRconCommand("gmx");
}
else
{
SendClientMessage(playerid, COLOR_RED, "You are not an admin!");
}
return 1;
}
if(strcmp(cmd, "/repair", true) == 0)
{
if(InVehicle == 1)
{
SetVehicleHealth(VehicleID, 1000);
SendClientMessage(playerid, COLOR_YELLOW, "Vehicle Repaired");
}
else
{
SendClientMessage(playerid, COLOR_RED, "You are not in any vehicle");
}
return 1;
}
if(!strcmp(cmd, "/drift", true))
{
if(InVehicle)
{
SetVehiclePos(VehicleID, 2327.2727, 1390.0819, 42.8203);
SetVehicleZAngle(VehicleID, 359.5266);
}
else
{
SetPlayerPos(playerid, 2327.2727, 1390.0819, 42.8203);
SetPlayerFacingAngle(playerid, 359.5266);
}
SetCameraBehindPlayer(playerid);
SetPlayerInterior(playerid, 0);
SendClientMessage(playerid, COLOR_ORANGE, "*** Welcome to Drift #1!");
return 1;
}
if(!strcmp(cmd, "/spawn", true))
{
if(InVehicle)
{
SetVehiclePos(VehicleID, 2232.0354,2453.2104,10.8727);
SetVehicleZAngle(VehicleID, 268.6226);
}
else
{
SetPlayerPos(playerid, 2232.0354,2453.2104,10.8727);
SetPlayerFacingAngle(playerid, 268.6226);
}
SetCameraBehindPlayer(playerid);
SetPlayerInterior(playerid, 0);
SendClientMessage(playerid, COLOR_ORANGE, "*** Welcome back to Spawn!");
return 1;
}
if(!strcmp(cmd, "/wang", true))
{
if(InVehicle)
{
SetVehiclePos(VehicleID, -1978.7017,287.7222,35.1719);
SetVehicleZAngle(VehicleID, 266.9272);
}
else
{
SetPlayerPos(playerid, -1978.7017,287.7222,35.1719);
SetPlayerFacingAngle(playerid, 268.6226);
}
SetCameraBehindPlayer(playerid);
SetPlayerInterior(playerid, 0);
SendClientMessage(playerid, COLOR_ORANGE, "*** Welcome to Wang Cars!");
return 1;
}
if(!strcmp(cmd, "/grovest", true))
{
if(InVehicle)
{
SetVehiclePos(VehicleID, 2500.2205,-1684.9989,13.4464);
SetVehicleZAngle(VehicleID, 16.2701);
}
else
{
SetPlayerPos(playerid, 2500.2205,-1684.9989,13.4464);
SetPlayerFacingAngle(playerid, 16.2701);
}
SetCameraBehindPlayer(playerid);
SetPlayerInterior(playerid, 0);
SendClientMessage(playerid, COLOR_ORANGE, "*** Welcome to The Skatepark!");
return 1;
}
if(!strcmp(cmd, "/skatepark", true))
{
if(InVehicle)
{
SetVehiclePos(VehicleID, 1919.8086,-1401.1349,13.5703);
SetVehicleZAngle(VehicleID, 174.1452);
}
else
{
SetPlayerPos(playerid, 1919.8086,-1401.1349,13.5703);
SetPlayerFacingAngle(playerid, 174.1452);
}
SetCameraBehindPlayer(playerid);
SetPlayerInterior(playerid, 0);
SendClientMessage(playerid, COLOR_ORANGE, "*** Welcome to The Skatepark!");
return 1;
}
if(strcmp(cmdtext, "/away", true) == 0)
{
SetPlayerInterior(playerid,3);
SetPlayerPos(playerid,2404.8855,1553.3513,68.4252);
SetPlayerFacingAngle(playerid,177.0350);
SetCameraBehindPlayer(playerid);
PlayerPlaySound(playerid,1082,198.3797,160.8905,1003.0300);
TogglePlayerControllable(playerid,0);
new away[MAX_PLAYER_NAME];
GetPlayerName(playerid, away, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s is now away!", away);
SendClientMessageToAll(COLOR_ORANGE, string);
return 1;
}
if(strcmp(cmdtext, "/back", true) == 0)
{
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,2232.0354,2453.2104,10.8727);
SetPlayerFacingAngle(playerid, 268.6226);
SetCameraBehindPlayer(playerid);
TogglePlayerControllable(playerid,1);
new back[MAX_PLAYER_NAME];
GetPlayerName(playerid, back, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s is back!", back);
SendClientMessageToAll(COLOR_ORANGE, string);
return 1;
}
if(strcmp(cmd, "/godmode", true) == 0)
{
if(IsAdmin == 1)
{
SetPlayerHealth(playerid, 99999);
SetPlayerArmour(playerid, 99999);
SendClientMessage(playerid, COLOR_GREEN, "Godmode Activated!");
}
else
{
SendClientMessage(playerid, COLOR_RED, "You are not an admin!");
}
return 1;
}
if(strcmp(cmd, "/nogodmode", true) == 0)
{
SetPlayerHealth(playerid, 100);
SendClientMessage(playerid, COLOR_GREEN, "Godmode Deactivated!");
return 1;
}
if(strcmp(cmdtext, "/taxi", true) == 0) {
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof (pname));
format(string, sizeof(string), " %s Needs Taxi", pname);
SendClientMessage(playerid, COLOR_GREEN, string); //
GameTextForAll(string ,3000,5);
return 1;
}
else if(strcmp(cmdtext, "/intaxi", true) == 0) {
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof (pname));
format(string, sizeof(string), " %s Doesent need taxi any more", pname);
SendClientMessage(playerid, COLOR_GREEN, string); //
GameTextForAll(string ,3000,5);
return 1;
}
else if(strcmp(cmd, "/iamtaxi", true) == 0) {
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof (pname));
format(string, sizeof(string), " %s Is now taxi driver if you need taxi type /taxi", pname);
SendClientMessage(playerid, COLOR_GREEN, string); //
GameTextForAll(string ,3000,5);
return 1;
}
if(strcmp(cmd, "/flip", true) == 0)
{
if(InVehicle == 1)
{
SetVehicleZAngle(VehicleID, 0);
}
else
{
SendClientMessage(playerid, COLOR_RED, "You are not in any vehicle!");
}
return 1;
}
if(strcmp(cmdtext, "/lock", true)==0)
{
if(InVehicle)
{
new State=GetPlayerState(playerid);
if(State!=PLAYER_STATE_DRIVER)
{
SendClientMessage(playerid,0xFFFF00AA,"You can only lock the doors as the driver.");
return 1;
}
new i;
for(i=0;i<MAX_PLAYERS;i++)
{
if(i != playerid)
{
SetVehicleParamsForPlayer(VehicleID,i, 0, 1);
}
}
SendClientMessage(playerid, 0xFFFF00AA, "Vehicle locked!");
GetPlayerPos(playerid,x,y,z);
PlayerPlaySound(playerid,1056,x,y,z);
}
else
{
SendClientMessage(playerid, 0xFFFF00AA, "You're not in a vehicle!");
}
return 1;
}
if(strcmp(cmdtext, "/unlock", true)==0)
{
if(InVehicle)
{
new State=GetPlayerState(playerid);
if(State!=PLAYER_STATE_DRIVER)
{
SendClientMessage(playerid,0xFFFF00AA,"You can only unlock the doors as the driver.");
return 1;
}
new i;
for(i=0;i<MAX_PLAYERS;i++)
{
SetVehicleParamsForPlayer(VehicleID,i, 0, 0);
}
SendClientMessage(playerid, 0xFFFF00AA, "Vehicle unlocked!");
GetPlayerPos(playerid,x,y,z);
PlayerPlaySound(playerid,1057,x,y,z);
}
else
{
SendClientMessage(playerid, 0xFFFF00AA, "You're not in a vehicle!");
}
return 1;
}
if(strcmp(cmd, "/day", true) == 0)
{
if(IsAdmin == 1)
{
SetWorldTime(12);
GameTextForPlayer(playerid, "~y~Good ~y~Day ~y~LOL",5000,5);
}
else
{
SendClientMessage(playerid, COLOR_RED, "You are not an admin!");
}
return 1;
}
if(strcmp(cmd, "/night", true) == 0)
{
if(IsAdmin == 1)
{
SetWorldTime(0);
GameTextForPlayer(playerid, "~b~Good ~b~Night ~b~LOL",5000,5);
}
else
{
SendClientMessage(playerid, COLOR_RED, "You are not an admin!");
}
return 1;
}
if(strcmp(cmd, "/jail", true) == 0)
{
if(IsAdmin == 1)
{
new PlayerID;
new tmp[256];
new pname[256];
new sname[256];
new str[256];
new str2[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /jail [playerid]");
}
PlayerID = strval (tmp);
SetPlayerPos(PlayerID,2404.8855,1553.3513,68.4252);
SetPlayerFacingAngle(PlayerID, 2.1700);
TogglePlayerControllable(playerid,0);
SetPlayerHealth(PlayerID, 99999);
GetPlayerName(PlayerID, pname, sizeof(str));
format(str, sizeof (str), "You have jailed %s", pname);
SendClientMessage(playerid, COLOR_GREEN, str);
GetPlayerName(playerid, sname, sizeof(str));
format(str2, sizeof (str), "You have been jailed by %s and you cant move without getting unjailed", sname);
SendClientMessage(PlayerID, COLOR_RED, str2);
}
else
{
SendClientMessage(playerid, COLOR_RED, "You are not an admin");
}
return 1;
}
if(strcmp(cmd, "/unjail", true) == 0)
{
if(IsAdmin == 1)
{
new PlayerID;
new tmp[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /unjail [playerid]");
return 1;
}
PlayerID = strval(tmp);
SetPlayerPos(PlayerID, 2327.2727, 1390.0819, 42.8203);
SetPlayerFacingAngle(playerid, 359.5266);
SetPlayerHealth(PlayerID, 100);
}
else
{
SendClientMessage(playerid, COLOR_RED, "You are not an admin!");
}
return 1;
}
if(strcmp(cmd, "/teleto", true) == 0)
{
if(IsAdmin == 1)
{
new PlayerID;
new tmp[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /teleto [playerid]");
return 1;
}
PlayerID = strval(tmp);
GetPlayerPos(PlayerID, x, y, z);
SetPlayerPos(playerid, x, y, z);
}
else
{
SendClientMessage(playerid, COLOR_RED, "You are not an admin!");
}
return 1;
}
if(strcmp(cmd, "/teletome", true) == 0)
{
if(IsAdmin == 1)
{
new PlayerID;
new tmp[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /teletome [playerid]");
return 1;
}
PlayerID = strval(tmp);
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(PlayerID, x, y, z);
}
else
{
SendClientMessage(playerid, COLOR_RED, "You are not an admin!");
}
return 1;
}
if(strcmp(cmd, "/carcolor", true) == 0)
{
new carcolor1;
new carcolor2;
new tmp[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /carcolor [carcolor1] [carcolor2]");
return 1;
}
carcolor1 = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /carcolor [carcolor1] [carcolor2]");
return 1;
}
carcolor2 = strval (tmp);
ChangeVehicleColor(VehicleID, carcolor1, carcolor2);
return 1;
}
if(strcmp(cmd, "/vehicle", true) == 0)
{
if(IsAdmin == 1)
{
new vehicleid;
new PlayerID;
new tmp[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /vehicle [playerid] [vehicleid]");
return 1;
}
PlayerID = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /vehicle [playerid] [vehicleid]");
return 1;
}
vehicleid = strval(tmp);
GetPlayerPos(PlayerID, x,y,z);
GetPlayerFacingAngle(PlayerID, ang);
CreateVehicle(vehicleid, x+1,y+1,z+1,0, -1, -1, 600);
}
else
{
SendClientMessage(playerid, COLOR_RED, "You are not an admin!");
}
return 1;
}
if(strcmp(cmd, "/component", true) == 0)
{
if(IsAdmin == 1)
{
new componentid;
new PlayerID;
new tmp[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /component [playerid] [componentid]");
return 1;
}
PlayerID = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /component [playerid] [componentid]");
return 1;
}
componentid = strval(tmp);
AddVehicleComponent(GetPlayerVehicleID(PlayerID), componentid);
}
else
{
SendClientMessage(playerid, COLOR_RED, "You are not an admin!");
}
return 1;
}
if(strcmp(cmd, "/weapon", true) == 0)
{
if(IsAdmin == 1)
{
new PlayerID;
new weaponid;
new ammo;
new tmp[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /weapon [playerid] [weaponid] [ammo]");
return 1;
}
PlayerID = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /weapon [playerid] [weaponid] [ammo]");
return 1;
}
weaponid = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /weapon [playerid] [weaponid] [ammo]");
return 1;
}
ammo = strval(tmp);
GivePlayerWeapon(PlayerID, weaponid, ammo);
}
else
{
SendClientMessage(playerid, COLOR_RED, "You are not an admin!");
}
return 1;
}
if(strcmp(cmd, "/sendcash", true) == 0)
{
if(IsAdmin == 1)
{
new PlayerID;
new tmp[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /sendcash [playerid] [amount]");
return 1;
}
PlayerID = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /sendcash [playerid] [amount]");
return 1;
}
moneys = strval(tmp);
GivePlayerMoney(PlayerID, moneys);
new str[256];
new str2[256];
new pname[256];
new sname[256];
new money = GetPlayerMoney(PlayerID);
GetPlayerName(PlayerID, sname, sizeof (str));
format(str, sizeof (str), "You have received $%d from admin %s.", money-500, sname);
SendClientMessage(PlayerID, COLOR_GREEN, str);
GetPlayerName(playerid, pname, sizeof (str));
format(str2, sizeof (str), "You have sent %s $%d", pname, money-500);
SendClientMessage(playerid, COLOR_GREEN, str2);
}
else
{
SendClientMessage(playerid, COLOR_RED, "You are not an admin!");
}
return 1;
}
if(strcmp(cmd, "/coord", true) == 0)
{
if(IsAdmin == 1)
{
new posx;
new posy;
new posz;
new tmp[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /coord [Float:x] [Float:y] [Float:z]");
return 1;
}
posx = strval(tmp);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /coord [Float:x] [Float:y] [Float:z]");
return 1;
}
posy = strval(tmp);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /coord [Float:x] [Float:y] [Float:z]");
return 1;
}
posz = strval(tmp);
SetPlayerPos(playerid, posx, posy, posz);
}
else
{
SendClientMessage(playerid, COLOR_RED, "You are not an admin!");
}
return 1;
}
if(strcmp(cmd, "/givecash", true) == 0)
{
new tmp[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /givecash [playerid] [amount]");
return 1;
}
giveplayerid = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /givecash [playerid] [amount]");
return 1;
}
moneys = strval(tmp);
//printf("givecash_command: %d %d",giveplayerid,moneys);
if (IsPlayerConnected(giveplayerid))
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
playermoney = GetPlayerMoney(playerid);
if (moneys > 0 && playermoney >= moneys)
{
GivePlayerMoney(playerid, (0 - moneys));
GivePlayerMoney(giveplayerid, moneys);
format(string, sizeof(string), "You have sent %s(player: %d), $%d.", giveplayer,giveplayerid, moneys);
SendClientMessage(playerid, COLOR_YELLOW, string);
format(string, sizeof(string), "You have recieved $%d from %s(player: %d).", moneys, sendername, playerid);
SendClientMessage(giveplayerid, COLOR_YELLOW, string);
printf("%s(playerid:%d) has transfered %d to %s(playerid:%d)",sendername, playerid, moneys, giveplayer, giveplayerid);
}
else
{
SendClientMessage(playerid, COLOR_YELLOW, "Invalid transaction amount.");
}
}
else
{
format(string, sizeof(string), "%d is not an active player.", giveplayerid);
SendClientMessage(playerid, COLOR_YELLOW, string);
}
return 1;
}
// PROCESS OTHER COMMANDS
return 0;
}