public 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 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; }