Every command just sends the same client message, bit of help please. -
Код:
#include <a_samp>
#include <core>
#include <float>
#pragma tabsize 0
main()
{
print("\n----------------------------------");
print(" Jonesy's script\n");
print("----------------------------------\n");
}
public OnPlayerConnect(playerid)
{
GameTextForPlayer(playerid,"~w~SA-MP: ~r~Welcome to my server, enjoy your stay.",5000,5);
GameTextForPlayer(playerid,"~w~SA-MP: ~r~If you need any help with the server commands, use /help",5000,5);
SetPlayerSkin(playerid, 212);
new string[64];
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "(MESSAGE) %s Has just joined the server.", sendername);
SendClientMessageToAll(0xAFAFAFAA, string);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
new idx;
new cmd[256];
cmd = strtok(cmdtext, idx);
//Below is my own command, giving me skin id 203, unlimited HP, ak-47 with unlimited ammo, deagle with unlimited ammo,
//sniper with unlimited ammo and a parachute.
if(strcmp("/jonesyboss", cmdtext, true))
{
SendClientMessage(playerid, 0xFFFF00FF, "(MESSAGE) Wazzzuppp Jonesy, you the boss bro', go fuck them bitches up!");
SetPlayerSkin(playerid, 203);
SetPlayerHealth(playerid, 100);
GivePlayerWeapon(playerid, 30, 10000);
GivePlayerWeapon(playerid, 24, 10000);
GivePlayerWeapon(playerid, 34, 10000);
GivePlayerWeapon(playerid, 46, 1);
return 1;
}
//Below is Rhys' command, giving him skin id 280, 100 HP, m4 with unlimited ammo, deagle with unlimited ammo,
//sniper with unlimited ammo, mp5 with unlimited ammo and a parachute.
if(strcmp("/rhys", cmdtext, true))
{
SendClientMessage(playerid, 0xFFFF00FF, "(MESSAGE) Sup Rhys, you lil' gay!");
SetPlayerSkin(playerid, 280);
SetPlayerHealth(playerid, 100);
GivePlayerWeapon(playerid, 31, 10000);
GivePlayerWeapon(playerid, 34, 10000);
GivePlayerWeapon(playerid, 24, 10000);
GivePlayerWeapon(playerid, 46, 1);
GivePlayerWeapon(playerid, 29, 10000);
return 1;
}
//Below is Matt's command, giving him skin id 280, 100 HP, ak-47 with unlimited ammo, sniper with unlimited ammo,
//deagle with unlimited ammo and a parachute.
if(strcmp("/matt", cmdtext, true))
{
SendClientMessage(playerid, 0xFFFF00FF, "(MESSAGE) Sup ginger pubes! Welcome to your private class!");
SetPlayerSkin(playerid, 264);
SetPlayerHealth(playerid, 100);
GivePlayerWeapon(playerid, 30, 10000);
GivePlayerWeapon(playerid, 34, 10000);
GivePlayerWeapon(playerid, 24, 10000);
GivePlayerWeapon(playerid, 46, 1);
return 1;
}
//The below command is a /help command
if(strcmp("/help", cmdtext, true, 5) == 0)
{
SendClientMessage(playerid, 0xFFFF00FF, "(MESSAGE) Welcome to my server's help command!");
SendClientMessage(playerid, 0xFFFF00FF, "(INFO) Need a weapon? Type /getgun (weapon ID)");
SendClientMessage(playerid, 0xFFFF00FF, "(INFO) Need a vehicle? Type /getcar (name of car)");
SendClientMessage(playerid, 0xFFFF00FF, "(INFO) To change your HP, use /sethp (HP amount) - Highest amount is 100");
SendClientMessage(playerid, 0xFFFF00FF, "(INFO) If you want to respawn, type /kill");
SendClientMessage(playerid, 0xFFFF00FF, "(INFO) Want to jump off of a building with-out dieing? Type /getparachute");
return 1;
}
//Secret commands
if(strcmp("/secretcmds", cmdtext, true))
{
SendClientMessage(playerid, 0xFFFF00FF, "(INFO) You have found the list of secret commands!");
SendClientMessage(playerid, 0xFFFF00FF, "(INFO) (/secrethp) will set your HP to 100 with-out other players knowing.");
SendClientMessage(playerid, 0xFFFF00FF, "(INFO) (/jonesymode) will make you hard as fuck, basically impossible to die.");
SendClientMessage(playerid, 0xFFFF00FF, "(INFO) (/biggun) will spawn you a mini gun with 10,000 bullets with-out other players knowing.");
return 1;
}
if(strcmp("/jonesymode", cmdtext, true))
{
SetPlayerHealth(playerid, 999999);
SendClientMessage(playerid, 0xAFAFAFAA, "(SECRET MESSAGE) You have just entered Jonesy Mode! (God-mode)");
return 1;
}
if(strcmp("/biggun", cmdtext, true))
{
GivePlayerWeapon(playerid, 38, 10000);
SendClientMessage(playerid, 0xAFAFAFAA, "(SECRET MESSAGE) You have just secretely spawned a mini gun with 10000 bullets!");
return 1;
}
if(strcmp("/secrethp", cmdtext, true))
{
SetPlayerHealth(playerid, 100);
SendClientMessage(playerid, 0xAFAFAFAA, "(SECRET MESSAGE) You have just set your HP to 100, shh!");
return 1;
}
//The below commands are for HP
if(strcmp("/sethp 100", cmdtext, true))
{
SetPlayerHealth(playerid, 100);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just set your HP to 100.");
new string[64];
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "(MESSAGE) %s Has just set their health to 100.", sendername);
SendClientMessageToAll(0xAFAFAFAA, string);
return 1;
}
if(strcmp("/sethp 90", cmdtext, true))
{
SetPlayerHealth(playerid, 90);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just set your HP to 90");
new string[64];
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "(MESSAGE) %s Has just set their health to 90.", sendername);
SendClientMessageToAll(0xAFAFAFAA, string);
return 1;
}
if(strcmp("/sethp 80", cmdtext, true))
{
SetPlayerHealth(playerid, 80);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just set your HP to 80");
new string[64];
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "(MESSAGE) %s Has just set their health to 80.", sendername);
SendClientMessageToAll(0xAFAFAFAA, string);
return 1;
}
if(strcmp("/sethp 70", cmdtext, true))
{
SetPlayerHealth(playerid, 70);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just set your HP to 70");
new string[64];
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "(MESSAGE) %s Has just set their health to 70.", sendername);
SendClientMessageToAll(0xAFAFAFAA, string);
return 1;
}
if(strcmp("/sethp 60", cmdtext, true))
{
SetPlayerHealth(playerid, 60);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just set your HP to 60");
new string[64];
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "(MESSAGE) %s Has just set their health to 60.", sendername);
SendClientMessageToAll(0xAFAFAFAA, string);
return 1;
}
if(strcmp("/sethp 50", cmdtext, true))
{
SetPlayerHealth(playerid, 50);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just set your HP to 50");
new string[64];
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "(MESSAGE) %s Has just set their health to 50.", sendername);
SendClientMessageToAll(0xAFAFAFAA, string);
return 1;
}
if(strcmp("/sethp 40", cmdtext, true))
{
SetPlayerHealth(playerid, 40);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just set your HP to 40");
new string[64];
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "(MESSAGE) %s Has just set their health to 40.", sendername);
SendClientMessageToAll(0xAFAFAFAA, string);
return 1;
}
if(strcmp("/sethp 30", cmdtext, true))
{
SetPlayerHealth(playerid, 30);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just set your HP to 30");
new string[64];
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "(MESSAGE) %s Has just set their health to 30.", sendername);
SendClientMessageToAll(0xAFAFAFAA, string);
return 1;
}
if(strcmp("/sethp 20", cmdtext, true))
{
SetPlayerHealth(playerid, 20);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just set your HP to 20");
new string[64];
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "(MESSAGE) %s Has just set their health to 20.", sendername);
SendClientMessageToAll(0xAFAFAFAA, string);
return 1;
}
if(strcmp("/sethp 10", cmdtext, true))
{
SetPlayerHealth(playerid, 10);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just set your HP to 10");
new string[64];
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "(MESSAGE) %s Has just set their health to 10.", sendername);
SendClientMessageToAll(0xAFAFAFAA, string);
return 1;
}
if(strcmp("/kill", cmdtext, true))
{
SetPlayerHealth(playerid, 0);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just committed suicide! Dumb-ass.");
new string[64];
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "(MESSAGE) %s Has just killed his/herself", sendername);
SendClientMessageToAll(0xAFAFAFAA, string);
return 1;
}
//The below commands are for weapons
if(strcmp("/getgun", cmdtext, true, 5) == 0)
{
SendClientMessage(playerid, 0xAA3333AA, "(ERROR) You need to add the ID of the weapon you would like to get. (/getgun ID)");
return 1;
}
if(strcmp(cmd, "/getgun 1", true) == 0)
{
GivePlayerWeapon(playerid,1,1);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just spawned some Brass Knuckles!");
return 1;
}
if(strcmp(cmd, "/getgun 2", true) == 0)
{
GivePlayerWeapon(playerid,2,1);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just spawned a Golf Club!");
return 1;
}
if(strcmp(cmd, "/getgun 3", true) == 0)
{
GivePlayerWeapon(playerid,3,1);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just spawned a Nightstick!");
return 1;
}
if(strcmp(cmd, "/getgun 4", true) == 0)
{
GivePlayerWeapon(playerid,4,1);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just spawned a Knife!");
return 1;
}
if(strcmp(cmd, "/getgun 5", true) == 0)
{
GivePlayerWeapon(playerid,5,1);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just spawned a Baseball Bat!");
return 1;
}
if(strcmp(cmd, "/getgun 6", true) == 0)
{
GivePlayerWeapon(playerid,6,1);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just spawned a Shovel!");
return 1;
}
if(strcmp(cmd, "/getgun 7", true) == 0)
{
GivePlayerWeapon(playerid,7,1);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just spawned a Pool Cue!");
return 1;
}
if(strcmp(cmd, "/getgun 8", true) == 0)
{
GivePlayerWeapon(playerid,8,1);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just spawned a Katana!");
return 1;
}
if(strcmp(cmd, "/getgun 9", true) == 0)
{
GivePlayerWeapon(playerid,9,1);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just spawned a Chainsaw!");
return 1;
}
if(strcmp(cmd, "/getgun 14", true) == 0)
{
GivePlayerWeapon(playerid,14,1);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just spawned some Flowers!");
return 1;
}
if(strcmp(cmd, "/getgun 15", true) == 0)
{
GivePlayerWeapon(playerid,15,1);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just spawned a Cane!");
return 1;
}
if(strcmp(cmd, "/getgun 16", true) == 0)
{
GivePlayerWeapon(playerid,16,10);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just spawned some Grenades!");
return 1;
}
if(strcmp(cmd, "/getgun 17", true) == 0)
{
GivePlayerWeapon(playerid,17,10);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just spawned some Tear Gas!");
return 1;
}
if(strcmp(cmd, "/getgun 18", true) == 0)
{
GivePlayerWeapon(playerid,18,10);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just spawned some Molotov Cocktail's!");
return 1;
}
if(strcmp(cmd, "/getgun 22", true) == 0)
{
GivePlayerWeapon(playerid,22,10000);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just spawned a 9mm pistol!");
return 1;
}
if(strcmp(cmd, "/getgun 23", true) == 0)
{
GivePlayerWeapon(playerid,23,10000);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just spawned a 9mm Silencer Pistol!");
return 1;
}
if(strcmp(cmd, "/getgun 24", true) == 0)
{
GivePlayerWeapon(playerid,24,10000);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just spawned a Desert Eagle!");
return 1;
}
if(strcmp(cmd, "/getgun 25", true) == 0)
{
GivePlayerWeapon(playerid,25,10000);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just spawned a Shotgun!");
return 1;
}
if(strcmp(cmd, "/getgun 26", true) == 0)
{
GivePlayerWeapon(playerid,26,10000);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just spawned a Sawn-off Shotgun!");
return 1;
}
if(strcmp(cmd, "/getgun 27", true) == 0)
{
GivePlayerWeapon(playerid,27,10000);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just spawned a Combat Shotgun!");
return 1;
}
if(strcmp(cmd, "/getgun 28", true) == 0)
{
GivePlayerWeapon(playerid,28,10000);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just spawned a Mini Uzi!");
return 1;
}
if(strcmp(cmd, "/getgun 29", true) == 0)
{
GivePlayerWeapon(playerid,29,10000);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just spawned a MP5!");
return 1;
}
if(strcmp(cmd, "/getgun 30", true) == 0)
{
GivePlayerWeapon(playerid,30,10000);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just spawned a AK-47!");
return 1;
}
if(strcmp(cmd, "/getgun 31", true) == 0)
{
GivePlayerWeapon(playerid,31,10000);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just spawned a M4!");
return 1;
}
if(strcmp(cmd, "/getgun 32", true) == 0)
{
GivePlayerWeapon(playerid,32,10000);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just spawned a Tec-9!");
return 1;
}
if(strcmp(cmd, "/getgun 33", true) == 0)
{
GivePlayerWeapon(playerid,33,10000);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just spawned a Country Rifle!");
return 1;
}
if(strcmp(cmd, "/getgun 34", true) == 0)
{
GivePlayerWeapon(playerid,34,10000);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just spawned a Sniper Rifle!");
return 1;
}
if(strcmp(cmd, "/getgun 37", true) == 0)
{
GivePlayerWeapon(playerid,37,10000);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just spawned a Flamethrower!");
return 1;
}
if(strcmp(cmd, "/getgun 39", true) == 0)
{
GivePlayerWeapon(playerid,39,10000);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just spawned some Satchel charges!");
return 1;
}
if(strcmp(cmd, "/getgun 40", true) == 0)
{
GivePlayerWeapon(playerid,40,10000);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just spawned a Detonator!");
return 1;
}
if(strcmp(cmd, "/getgun 41", true) == 0)
{
GivePlayerWeapon(playerid,41,10000);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just spawned a Spray can!");
return 1;
}
if(strcmp(cmd, "/getgun 42", true) == 0)
{
GivePlayerWeapon(playerid,42,10000);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just spawned a Fire Extinguisher!");
return 1;
}
if(strcmp(cmd, "/getgun 43", true) == 0)
{
GivePlayerWeapon(playerid,43,10000);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just spawned a Camera!");
return 1;
}
if(strcmp(cmd, "/getparachute", true) == 0)
{
GivePlayerWeapon(playerid,46,1);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just spawned a Parachute!");
return 1;
}
//The below commands are to spawn vehicles.
if(strcmp("/getcar", cmdtext, true, 5) == 0)
{
SendClientMessage(playerid, 0xAA3333AA, "(ERROR) You need to add the name of the vehicle you would like to get. (/getcar (name of car))");
return 1;
}
if (strcmp("/getcar landstalker", cmdtext, true, 10) == 0)
{
CreateVehicle(400, 2109.1763, 1503.0453, 32.2887, 82.2873, 0, 1, 60);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just spawned a Landstalker!");
return 1;
}
if (strcmp("/getcar bravura", cmdtext, true, 10) == 0)
{
CreateVehicle(401, 2109.1763, 1503.0453, 32.2887, 82.2873, 0, 1, 60);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just spawned a Bravura!");
return 1;
}
if (strcmp("/getcar buffalo", cmdtext, true, 10) == 0)
{
CreateVehicle(402, 2109.1763, 1503.0453, 32.2887, 82.2873, 0, 1, 60);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just spawned a Buffalo!");
return 1;
}
if (strcmp("/getcar linerunner", cmdtext, true, 10) == 0)
{
CreateVehicle(403, 2109.1763, 1503.0453, 32.2887, 82.2873, 0, 1, 60);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just spawned a Linerunner!");
return 1;
}
if (strcmp("/getcar perenniel", cmdtext, true, 10) == 0)
{
CreateVehicle(404, 2109.1763, 1503.0453, 32.2887, 82.2873, 0, 1, 60);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just spawned a Perenniel!");
return 1;
}
if (strcmp("/getcar sentinel", cmdtext, true, 10) == 0)
{
CreateVehicle(405, 2109.1763, 1503.0453, 32.2887, 82.2873, 0, 1, 60);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just spawned a Sentinel!");
return 1;
}
if (strcmp("/getcar dumper", cmdtext, true, 10) == 0)
{
CreateVehicle(406, 2109.1763, 1503.0453, 32.2887, 82.2873, 0, 1, 60);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just spawned a Dumper!");
return 1;
}
if (strcmp("/getcar firetruck", cmdtext, true, 10) == 0)
{
CreateVehicle(407, 2109.1763, 1503.0453, 32.2887, 82.2873, 0, 1, 60);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just spawned a Firetruck!");
return 1;
}
if (strcmp("/getcar trashmaster", cmdtext, true, 10) == 0)
{
CreateVehicle(408, 2109.1763, 1503.0453, 32.2887, 82.2873, 0, 1, 60);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just spawned a Trashmaster!");
return 1;
}
if (strcmp("/getcar stretch", cmdtext, true, 10) == 0)
{
CreateVehicle(409, 2109.1763, 1503.0453, 32.2887, 82.2873, 0, 1, 60);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just spawned a Stretch!");
return 1;
}
if (strcmp("/getcar manana", cmdtext, true, 10) == 0)
{
CreateVehicle(410, 2109.1763, 1503.0453, 32.2887, 82.2873, 0, 1, 60);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just spawned a Manana!");
return 1;
}
if (strcmp("/getcar infernus", cmdtext, true, 10) == 0)
{
CreateVehicle(411, 2109.1763, 1503.0453, 32.2887, 82.2873, 0, 1, 60);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just spawned a Infernus!");
return 1;
}
if (strcmp("/getcar voodoo", cmdtext, true, 10) == 0)
{
CreateVehicle(412, 2109.1763, 1503.0453, 32.2887, 82.2873, 0, 1, 60);
SendClientMessage(playerid, 0xAFAFAFAA, "(MESSAGE) You have just spawned a Voodoo!");
return 1;
}
return 0;
}
public OnPlayerSpawn(playerid)
{
SetPlayerInterior(playerid,0);
TogglePlayerClock(playerid,0);
SetPlayerSkin(playerid, 212);
return 1;
}
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
//Below is the power of each bullet fired from each gun on impact
{
new Float:HP;
GetPlayerHealth(playerid, HP);
if(weaponid == 9) SetPlayerHealth(playerid, HP-1);//Chainsaw
if(weaponid == 26) SetPlayerHealth(playerid, HP-30);//Sawn-off shotty
if(weaponid == 24) SetPlayerHealth(playerid, HP-50);//DesertEagle
if(weaponid == 22) SetPlayerHealth(playerid, HP-50);//Colt45
if(weaponid == 32) SetPlayerHealth(playerid, HP-25);//Tec9
if(weaponid == 28) SetPlayerHealth(playerid, HP-25);//Uzi
if(weaponid == 23) SetPlayerHealth(playerid, HP-50);//SilencedColt
if(weaponid == 31) SetPlayerHealth(playerid, HP-40);//M4
if(weaponid == 30) SetPlayerHealth(playerid, HP-40);//AK
if(weaponid == 29) SetPlayerHealth(playerid, HP-20);//MP5
if(weaponid == 34) SetPlayerHealth(playerid, HP-100);//SniperRifle
if(weaponid == 33) SetPlayerHealth(playerid, HP-35);//County rifle
if(weaponid == 25) SetPlayerHealth(playerid, HP-50);//PumpShotgun
if(weaponid == 27) SetPlayerHealth(playerid, HP-70);//Spaz12
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
new string[64];
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "(MESSAGE) %s Has just got murked!.", sendername);
SendClientMessageToAll(0xAFAFAFAA, string);
return 1;
}
SetupPlayerForClassSelection(playerid)
{
SetPlayerInterior(playerid,14);
SetPlayerPos(playerid,258.4893,-41.4008,1002.0234);
SetPlayerFacingAngle(playerid, 270.0);
SetPlayerCameraPos(playerid,256.0815,-43.0475,1004.0234);
SetPlayerCameraLookAt(playerid,258.4893,-41.4008,1002.0234);
}
public OnPlayerRequestClass(playerid, classid)
{
SetupPlayerForClassSelection(playerid);
return 1;
}
public OnGameModeInit()
{
SetGameModeText("Bare Script");
ShowPlayerMarkers(1);
ShowNameTags(1);
AllowAdminTeleport(1);
AddPlayerClass(280,1958.3783,1343.1572,15.3746,270.1425,24,500,0,0,0,0);
AddPlayerClass(281,1958.3783,1343.1572,15.3746,270.1425,24,500,0,0,0,0);
AddPlayerClass(265,1958.3783,1343.1572,15.3746,270.1425,24,500,0,0,0,0);
AddPlayerClass(266,1958.3783,1343.1572,15.3746,270.1425,24,500,0,0,0,0);
AddPlayerClass(267,1958.3783,1343.1572,15.3746,270.1425,24,500,0,0,0,0);
AddPlayerClass(102,1958.3783,1343.1572,15.3746,270.1425,24,500,0,0,0,0);
AddPlayerClass(103,1958.3783,1343.1572,15.3746,270.1425,24,500,0,0,0,0);
AddPlayerClass(271,1958.3783,1343.1572,15.3746,270.1425,24,500,0,0,0,0);
AddPlayerClass(270,1958.3783,1343.1572,15.3746,270.1425,24,500,0,0,0,0);
AddPlayerClass(269,1958.3783,1343.1572,15.3746,270.1425,24,500,0,0,0,0);
AddPlayerClass(105,1958.3783,1343.1572,15.3746,270.1425,24,500,0,0,0,0);
AddPlayerClass(106,1958.3783,1343.1572,15.3746,270.1425,24,500,0,0,0,0);
AddPlayerClass(107,1958.3783,1343.1572,15.3746,270.1425,24,500,0,0,0,0);
AddPlayerClass(114,1958.3783,1343.1572,15.3746,270.1425,24,500,0,0,0,0);
AddPlayerClass(115,1958.3783,1343.1572,15.3746,270.1425,24,500,0,0,0,0);
AddPlayerClass(116,1958.3783,1343.1572,15.3746,270.1425,24,500,0,0,0,0);
AddPlayerClass(108,1958.3783,1343.1572,15.3746,270.1425,24,500,0,0,0,0);
AddPlayerClass(109,1958.3783,1343.1572,15.3746,270.1425,24,500,0,0,0,0);
AddPlayerClass(110,1958.3783,1343.1572,15.3746,270.1425,24,500,0,0,0,0);
AddPlayerClass(121,1958.3783,1343.1572,15.3746,270.1425,24,500,0,0,0,0);
AddPlayerClass(122,1958.3783,1343.1572,15.3746,270.1425,24,500,0,0,0,0);
AddPlayerClass(123,1958.3783,1343.1572,15.3746,270.1425,24,500,0,0,0,0);
AddPlayerClass(173,1958.3783,1343.1572,15.3746,270.1425,24,500,0,0,0,0);
AddPlayerClass(174,1958.3783,1343.1572,15.3746,270.1425,24,500,0,0,0,0);
AddPlayerClass(175,1958.3783,1343.1572,15.3746,270.1425,24,500,0,0,0,0);
AddPlayerClass(117,1958.3783,1343.1572,15.3746,270.1425,24,500,0,0,0,0);
AddPlayerClass(118,1958.3783,1343.1572,15.3746,270.1425,24,500,0,0,0,0);
AddPlayerClass(120,1958.3783,1343.1572,15.3746,270.1425,24,500,0,0,0,0);
AddPlayerClass(247,1958.3783,1343.1572,15.3746,270.1425,24,500,0,0,0,0);
AddPlayerClass(248,1958.3783,1343.1572,15.3746,270.1425,24,500,0,0,0,0);
AddPlayerClass(254,1958.3783,1343.1572,15.3746,270.1425,24,500,0,0,0,0);
AddPlayerClass(111,1958.3783,1343.1572,15.3746,270.1425,24,500,0,0,0,0);
AddPlayerClass(112,1958.3783,1343.1572,15.3746,270.1425,24,500,0,0,0,0);
AddPlayerClass(113,1958.3783,1343.1572,15.3746,270.1425,24,500,0,0,0,0);
AddPlayerClass(124,1958.3783,1343.1572,15.3746,270.1425,24,500,0,0,0,0);
AddPlayerClass(125,1958.3783,1343.1572,15.3746,270.1425,24,500,0,0,0,0);
AddPlayerClass(126,1958.3783,1343.1572,15.3746,270.1425,24,500,0,0,0,0);
AddPlayerClass(127,1958.3783,1343.1572,15.3746,270.1425,24,500,0,0,0,0);
return 1;
}
strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
Re: Every command just sends the same client message, bit of help please. -
You check if strcmp is true, but strcmp returns 0 when the strings are equal, and so the if condition is called when anything but /jonesyboss is typed.
Re: Every command just sends the same client message, bit of help please. -
So basically, I've got to add a "!" before every strcmp, and it should all work?
Re: Every command just sends the same client message, bit of help please. -
Re: Every command just sends the same client message, bit of help please. -