03.12.2011, 03:48
Please help with my safezone when i type /suicide the command does not allowed me to use it because i'm on safe zone but i'm not in safezone and also i need help with reseting the weapon on Safe Zone and Giving back when in out safe zone heres the code
pawn Код:
#include <a_samp>
#include <zcmd>
#include <sscanf2>
//============================================================================//
new counter = 0;
#define for2(%0,%1) for(new %1=0;%1<%0;%1++) if(IsPlayerConnected(%1))
new VehicleNames[212][] = {
"Landstalker","Bravura","Buffalo","Linerunner","Pereniel","Sentinel","Dumper","Firetruck","Trashmaster","Stretch","Manana","Infernus",
"Voodoo","Pony","Mule","Cheetah","Ambulance","Leviathan","Moonbeam","Esperanto","Taxi","Washington","Bobcat","Mr Whoopee","BF Injection",
"Hunter","Premier","Enforcer","Securicar","Banshee","Predator","Bus","Rhino","Barracks","Hotknife","Trailer","Previon","Coach","Cabbie",
"Stallion","Rumpo","RC Bandit","Romero","Packer","Monster","Admiral","Squalo","Seasparrow","Pizzaboy","Tram","Trailer","Turismo","Speeder",
"Reefer","Tropic","Flatbed","Yankee","Caddy","Solair","Berkley's RC Van","Skimmer","PCJ-600","Faggio","Freeway","RC Baron","RC Raider",
"Glendale","Oceanic","Sanchez","Sparrow","Patriot","Quad","Coastguard","Dinghy","Hermes","Sabre","Rustler","ZR3 50","Walton","Regina",
"Comet","BMX","Burrito","Camper","Marquis","Baggage","Dozer","Maverick","News Chopper","Rancher","FBI Rancher","Virgo","Greenwood",
"Jetmax","Hotring","Sandking","Blista Compact","Police Maverick","Boxville","Benson","Mesa","RC Goblin","Hotring Racer A","Hotring Racer B",
"Bloodring Banger","Rancher","Super GT","Elegant","Journey","Bike","Mountain Bike","Beagle","Cropdust","Stunt","Tanker","RoadTrain",
"Nebula","Majestic","Buccaneer","Shamal","Hydra","FCR-900","NRG-500","HPV1000","Cement Truck","Tow Truck","Fortune","Cadrona","FBI Truck",
"Willard","Forklift","Tractor","Combine","Feltzer","Remington","Slamvan","Blade","Freight","Streak","Vortex","Vincent","Bullet","Clover",
"Sadler","Firetruck","Hustler","Intruder","Primo","Cargobob","Tampa","Sunrise","Merit","Utility","Nevada","Yosemite","Windsor","Monster A",
"Monster B","Uranus","Jester","Sultan","Stratum","Elegy","Raindance","RC Tiger","Flash","Tahoma","Savanna","Bandito","Freight","Trailer",
"Kart","Mower","Duneride","Sweeper","Broadway","Tornado","AT-400","DFT-30","Huntley","Stafford","BF-400","Newsvan","Tug","Trailer A","Emperor",
"Wayfarer","Euros","Hotdog","Club","Trailer B","Trailer C","Andromada","Dodo","RC Cam","Launch","Police Car (LSPD)","Police Car (SFPD)",
"Police Car (LVPD)","Police Ranger","Picador","S.W.A.T. Van","Alpha","Phoenix","Glendale","Sadler","Luggage Trailer A","Luggage Trailer B",
"Stair Trailer","Boxville","Farm Plow","Utility Trailer"
};
#define RANDOM_MESSAGE_TIMER 100000
new messagenumber = 0;
new messages[][] =
{
"Want to change your skin? use our /setskin command"
};
//============================================================================//
new togglepm[MAX_PLAYERS];
new EnterSafeZone[MAX_PLAYERS];
new SafeZoneTimer; //Safe Zone Timer
new SafeZone1; //Spawnpoint
//============================================================================//
forward Minutescore();
forward InfiniteNitro();
forward Autoannounce();
forward AutoRepair();
forward SafeZone();
//============================================================================//
#define red "{FF002B}"
#define pink "{FF00D9}"
#define purple "{DFA7F2}"
#define blue "{A1C2FF}"
#define green "{008000}"
#define yellow "{FAF623}"
#define black "{69670C}"
#define orange "{F2C80C}"
#define ice "{03F2FF}"
#define white "{FFFFFF}"
#define lime "{00FF40}"
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_RED 0xFF0000FF
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_PINK 0xFF66FFAA
#define COLOR_BLUE 0x0000BBAA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_DARKRED 0x660000AA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_BRIGHTRED 0xFF0000AA
#define COLOR_INDIGO 0x4B00B0AA
#define COLOR_VIOLET 0x9955DEEE
#define COLOR_LIGHTRED 0xFF99AADD
#define COLOR_SEAGREEN 0x00EEADDF
#define COLOR_GRAYWHITE 0xEEEEFFC4
#define COLOR_LIGHTNEUTRALBLUE 0xabcdef66
#define COLOR_GREENISHGOLD 0xCCFFDD56
#define COLOR_LIGHTBLUEGREEN 0x0FFDD349
#define COLOR_NEUTRALBLUE 0xABCDEF01
#define COLOR_LIGHTCYAN 0xAAFFCC33
#define COLOR_LEMON 0xDDDD2357
#define COLOR_MEDIUMBLUE 0x63AFF00A
#define COLOR_NEUTRAL 0xABCDEF97
#define COLOR_BLACK 0x00000000
#define COLOR_NEUTRALGREEN 0x81CFAB00
#define COLOR_DARKGREEN 0x12900BBF
#define COLOR_LIGHTGREEN 0x24FF0AB9
#define COLOR_DARKBLUE 0x300FFAAB
#define COLOR_BLUEGREEN 0x46BBAA00
#define COLOR_PINK 0xFF66FFAA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_DARKRED 0x660000AA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_PURPLE 0x800080AA
#define COLOR_GRAD1 0xB4B5B7FF
#define COLOR_GRAD2 0xBFC0C2FF
#define COLOR_RED1 0xFF0000AA
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_BROWN 0x993300AA
#define COLOR_CYAN 0x99FFFFAA
#define COLOR_TAN 0xFFFFCCAA
#define COLOR_PINK 0xFF66FFAA
#define COLOR_KHAKI 0x999900AA
#define COLOR_LIME 0x99FF00AA
#define COLOR_SYSTEM 0xEFEFF7AA
#define COLOR_GRAD2 0xBFC0C2FF
#define COLOR_GRAD4 0xD8D8D8FF
#define COLOR_GRAD6 0xF0F0F0FF
#define COLOR_GRAD2 0xBFC0C2FF
#define COLOR_GRAD3 0xCBCCCEFF
#define COLOR_GRAD5 0xE3E3E3FF
#define COLOR_GRAD1 0xB4B5B7FF
//============================================================================//
#if defined FILTERSCRIPT
//============================================================================//
#else
main()
{
print("\n----------------------------------");
print(" Xtreme Stunt 0.3c Version 1.0 ");
print(" Made by [SP]Mr.Kakashi[WP] ");
print(" Associate with WP Management ");
print(" Script Loaded! ");
print("----------------------------------\n");
}
#endif
public OnGameModeInit()
{
SetTimer("Minutescore", 60000, true);
SetTimer("InfiniteNitro",2000,1);
SetTimer("Autoannounce", RANDOM_MESSAGE_TIMER, true);
SetTimer("AutoRepair", 1000, 1);
SafeZoneTimer = SetTimer("SafeZone", 200, true);
//============================================================================//
SafeZone1 = GangZoneCreate(-381.318511, 1235.180419, -229.318511, 1379.180419);
//============================================================================//
//============================================================================//
/* Spawnpoint & Drift1 Map Objects */
AddStaticVehicleEx(562,-288.69921875,1326.39941406,54.20000076,82.24645996,-1,-1,15); //Elegy
AddStaticVehicleEx(562,-289.29998779,1322.09997559,54.20000076,82.24365234,-1,-1,15); //Elegy
AddStaticVehicleEx(560,-289.50000000,1317.40002441,54.09999847,81.99645996,-1,-1,15); //Sultan
AddStaticVehicleEx(560,-290.20001221,1312.69995117,54.00000000,81.99645996,-1,-1,15); //Sultan
AddStaticVehicleEx(411,-291.10000610,1303.90002441,53.79999924,82.00000000,-1,-1,15); //Infernus
AddStaticVehicleEx(411,-290.50000000,1308.09960938,53.90000153,81.99645996,-1,-1,15); //Infernus
AddStaticVehicleEx(451,-292.70001221,1294.50000000,53.50000000,80.50000000,-1,-1,15); //Turismo
AddStaticVehicleEx(451,-292.09960938,1299.39941406,53.59999847,79.99694824,-1,-1,15); //Turismo
CreateObject(978,-337.60000610,1310.50000000,51.50000000,0.00000000,0.00000000,338.00000000); //object(sub_roadright) (1)
CreateObject(978,-345.39999390,1315.40002441,51.50000000,0.00000000,0.00000000,317.99536133); //object(sub_roadright) (2)
CreateObject(13666,-275.29998779,1549.09997559,79.69999695,18.00000000,0.00000000,320.00000000); //object(loopwee) (2)
CreateObject(1633,-271.10000610,1556.19995117,77.50000000,16.00000000,0.00000000,314.00000000); //object(landjump) (1)
CreateObject(1633,-268.50000000,1558.40002441,80.09999847,25.99169922,0.00000000,313.98925781); //object(landjump) (5)
CreateObject(1633,-266.20001221,1560.59997559,84.00000000,35.98815918,0.00000000,313.98925781); //object(landjump) (6)
CreateObject(18449,-228.39999390,1592.69995117,69.69999695,0.00000000,0.00000000,42.00000000); //object(cs_roadbridge01) (1)
CreateObject(18449,-169.39999390,1645.80004883,69.80000305,0.00000000,0.00000000,41.99523926); //object(cs_roadbridge01) (2)
CreateObject(18449,-58.00000000,1744.59997559,28.00000000,359.00000000,21.00000000,41.74523926); //object(cs_roadbridge01) (4)
CreateObject(18449,-112.00000000,1697.00000000,55.70000076,358.99475098,20.99487305,41.74255371); //object(cs_roadbridge01) (5)
//============================================================================//
UsePlayerPedAnims();
SendRconCommand("mapname Stunt Arena");
SetGameModeText("Stunt/DM/Drift/Freeroam");
//============================================================================//
for(new skinid = 0; skinid < 300; skinid++)
{
if(IsValidSkin(skinid))
{
AddPlayerClass(skinid, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
}
}
//============================================================================//
return 1;
}
public OnGameModeExit()
{
KillTimer(SafeZoneTimer);
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
ApplyAnimation(playerid,"DANCING","DNC_M_E",3.1,0,0,0,100,1);
PlayerPlaySound(playerid, 1185, 0.0, 0.0, 10.0);
SetPlayerFacingAngle(playerid, 65.6557);
SetPlayerPos(playerid,-248.4268,1362.1091,68.7860);
SetPlayerCameraPos(playerid, -255.2794,1365.9083,73.2267);
SetPlayerCameraLookAt(playerid, -248.4268,1362.1091,68.7860);
return 1;
}
public OnPlayerConnect(playerid)
{
SetPlayerColor(playerid, COLOR_RED);
togglepm[playerid] = 1;
GameTextForPlayer(playerid, "~r~] ~y~Xtreme Stunt ~r~]", 2000, 4);
new string[64], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,sizeof string,"%s has joined Xtreme Stunt!",pName);
SendClientMessageToAll(COLOR_GREY,string);
format(string,sizeof string,"Welcome %s to Xtreme Stunt!",pName);
SendClientMessage(playerid, COLOR_WHITE,string);
SendClientMessage(playerid, COLOR_WHITE, "SERVER: Welcome experience our Stunt/DM/Freeroam/Drift & many more...");
SendClientMessage(playerid, COLOR_WHITE, "SERVER: /cmds to see all available commands");
new
str[156];
for2(MAX_PLAYERS,i)
counter++;
if(counter <= 2) return SendClientMessage(playerid,COLOR_RED,"There is current no players online in the server since you join");
format(str, sizeof(str), "There is current %d players online in the server since you join", counter);
SendClientMessage(playerid,COLOR_WHITE, str);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
PlayerPlaySound(playerid, 1186, 0.0, 0.0, 10.0);
new
string[64],
name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
switch(reason)
{
case 0: format(string,sizeof string,"%s left the server (Timed out)",name);
case 1: format(string,sizeof string,"%s left the server (Leaving)",name);
case 2: format(string,sizeof string,"%s left the server (Kicked/Banned)",name);
}
SendClientMessageToAll(COLOR_GREY,string);
counter--;
return 1;
}
public OnPlayerSpawn(playerid)
{
PlayerPlaySound(playerid, 1186, 0.0, 0.0, 10.0);
SetCameraBehindPlayer(playerid);
SetPlayerFacingAngle(playerid, 287.6453);
SetPlayerPos(playerid, -309.3185,1299.1804,53.6643);
GangZoneShowForPlayer(playerid, SafeZone1, COLOR_GREEN);
return 1;
}
public Minutescore()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
SetPlayerScore(i, GetPlayerScore(i)+1);
}
}
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
new string[128], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s "white"(%d): %s",pName, playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
return 0;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}
public SafeZone()
{
for(new i=0, m=MAX_PLAYERS; i<m; i++)
{
if(IsPlayerInArea(i, -381.318511, 1235.180419, -229.318511, 1379.180419) && !EnterSafeZone[i])
{
SetPVarInt(i, "weapons", GetPlayerWeapon(i));
SetPVarInt(i, "ammo", GetPlayerAmmo(i));
ResetPlayerWeapons(i);
EnterSafeZone[i] = 1;
}
else if(EnterSafeZone[i])
{
GivePlayerWeapon(i,GetPVarInt(i,"weapons"),GetPVarInt(i,"ammo"));
EnterSafeZone[i] = 0;
}
}
return true;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}
public InfiniteNitro()
{
new vehicleid;
for(new i=0;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
if(GetPlayerState(i)==2)
{
if(GetPlayerState(i) != PLAYER_STATE_DRIVER) return SendClientMessage(i,COLOR_RED, "ERROR: You must be driver to use the nitro!");
vehicleid= GetPlayerVehicleID(i);
if(CheckVehicle(vehicleid))
AddVehicleComponent(vehicleid,1010);
}
}
}
return 0;
}
public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}
public OnRconCommand(cmd[])
{
return 1;
}
public Autoannounce()
{
if(messagenumber == sizeof(messages)) messagenumber = 0;
SendClientMessageToAll(COLOR_RED, messages[messagenumber]);
messagenumber ++;
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
if(GetPlayerSkin(playerid) == 29 && GetPlayerScore(playerid) < 100)
{
GameTextForPlayer(playerid, "~r~You need 100 score to use and spawn with this skin", 2000,3);
return 0;
}
return 1;
}
public AutoRepair()
{
for(new playerid=0; playerid<MAX_PLAYERS; playerid++) {
if(IsPlayerConnected(playerid)) {
new Float:health, cid;
if (IsPlayerInAnyVehicle(playerid)) {
cid = GetPlayerVehicleID(playerid);
GetVehicleHealth(cid, health);
if (health < 300) {
PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
GameTextForPlayer(playerid,"~g~Vehicle Repaired!",3000,3);
RepairVehicle(GetPlayerVehicleID(playerid));
}
}
}
}
return 1;
}
public OnObjectMoved(objectid)
{
return 1;
}
public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}
public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}
public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}
public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}
public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}
public OnPlayerExitedMenu(playerid)
{
return 1;
}
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
new vehicleid;
new Float:x,Float:y,Float:z;
if(IsPlayerInAnyVehicle(playerid))
{
if(newkeys == KEY_SUBMISSION)
{
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid,COLOR_RED, "ERROR: You must be driver to use this key!");
vehicleid = GetPlayerVehicleID(playerid);
GetVehicleVelocity(vehicleid,x,y,z);
SetVehicleVelocity(vehicleid,x,y,z+0.3);
}
if((newkeys == 2))
{
new currentveh;
new Float:angle;
currentveh = GetPlayerVehicleID(playerid);
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid,COLOR_RED, "ERROR: You must be driver to use this key!");
GetVehicleZAngle(currentveh, angle);
SetVehicleZAngle(currentveh, angle);
GameTextForPlayer(playerid,"~g~Vehicle Flipped!",3000,3);
PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
}
}
return 1;
}
public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}
public OnPlayerUpdate(playerid)
{
return 1;
}
public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}
public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}
public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}
public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
//============================================================================//
stock IsValidSkin(skinid)
{
if(skinid < 0 || skinid > 299) return 0;
switch(skinid)
{
case 3, 4, 5, 6, 8, 42, 65, 74, 86, 119, 149, 208, 273, 289: return false;
}
return true;
}
stock GetVehicleModelIDFromName(const vname[])
{
for(new i=0; i < sizeof(VehicleNames); i++)
{
if (strfind(VehicleNames[i], vname, true) != -1) return i + 400;
}
return -1;
}
stock IsNumeric(const string[])
{
for (new i = 0, j = strlen(string); i < j; i++)
{
if (string[i] > '9' || string[i] < '0') return 0;
}
return 1;
}
stock CheckVehicle(vehicleid)
{
#define MAX_INVALID_NOS_VEHICLES 13
new InvalidNOSVehicles[MAX_INVALID_NOS_VEHICLES] =
{
522,481,441,468,448,446,513,521,510,430,520,476,463
};
for(new i = 0; i < MAX_INVALID_NOS_VEHICLES; i++)
{
if(GetVehicleModel(vehicleid) == InvalidNOSVehicles[i]) return false;
}
return true;
}
stock IsPlayerInArea(playerid, Float:minx, Float:maxx, Float:miny, Float:maxy)
{
new
Float:x,
Float:y,
Float:z;
GetPlayerPos(playerid, x, y, z);
if (x > minx && x < maxx && y > miny && y < maxy) return true;
return false;
}
stock GetSpeed(playerid)
{
new Float: Pos[4];
GetVehicleVelocity(GetPlayerVehicleID(playerid), Pos[0], Pos[1], Pos[2]);
return floatround(1.61 * floatsqroot(floatabs(floatpower(Pos[0] + Pos[1] + Pos[2], 2))) * 100);
}
//============================================================================//
CMD:v(playerid,params[])
{
new vID[32],modelid,color1,color2;
if(sscanf(params,"s[128]dd",vID,color1,color2)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /v <vehiclename/id> <color1> <color2>");
if(IsNumeric(vID)) modelid = strval(vID);
else modelid = GetVehicleModelIDFromName(vID);
if(modelid < 400 || modelid > 611) return SendClientMessage(playerid,COLOR_RED, "Invalid Vehiclename/ID!");
new Float:pVposX, Float:pVposY, Float:pVposZ, Float:pVposFA;
GetPlayerPos(playerid, pVposX, pVposY, pVposZ);
GetPlayerFacingAngle(playerid, pVposFA);
if(IsPlayerInAnyVehicle(playerid))
{
new VID = GetPlayerVehicleID(playerid);
GetVehicleZAngle(VID, pVposFA);
}
new CVID, pVW, pINT;
pVW = GetPlayerVirtualWorld(playerid);
pINT = GetPlayerInterior(playerid);
CVID = CreateVehicle(modelid, pVposX, pVposY, pVposZ+0.6, pVposFA,color1,color2,0);
SetVehicleVirtualWorld(CVID, pVW);
LinkVehicleToInterior(CVID, pINT);
PutPlayerInVehicle(playerid,CVID,0);
new string[128];
format(string,sizeof string,"VEHICLE: "yellow"%s (model id: %i) "green"has been spawned!",VehicleNames[modelid-400],modelid);
SendClientMessage(playerid,COLOR_WHITE,string);
return 1;
}
CMD:setcolor(playerid, params[])
{
new string[128],color = random(12);
color = GetPlayerColor(playerid);
if(isnull(params))
{
SendClientMessage(playerid, COLOR_RED,"USAGE: /setcolor <0 - 10>");
SendClientMessage(playerid, COLOR_WHITE,"if you do not want color ids type "green"randomcolor "white"it will pick you a random color");
}
if(strcmp(params, "0", true))
{
SetPlayerColor(playerid, COLOR_BLACK);
SendClientMessage(playerid, COLOR_GREEN, "You change your color name to "yellow"Black");
return 1;
}
else if(strcmp(params, "1", true))
{
SetPlayerColor(playerid, COLOR_WHITE);
SendClientMessage(playerid, COLOR_GREEN, "You change your color name to "yellow"White");
return 1;
}
else if(strcmp(params, "2", true))
{
SetPlayerColor(playerid, COLOR_GREY);
SendClientMessage(playerid, COLOR_GREEN, "You change your color name to "yellow"Grey");
return 1;
}
else if(strcmp(params, "3", true))
{
SetPlayerColor(playerid, COLOR_ORANGE);
SendClientMessage(playerid, COLOR_GREEN, "You change your color name to "yellow"Orange");
return 1;
}
else if(strcmp(params, "4", true))
{
SetPlayerColor(playerid, COLOR_YELLOW);
SendClientMessage(playerid, COLOR_GREEN, "You change your color name to "yellow"Yellow");
return 1;
}
else if(strcmp(params, "5", true))
{
SetPlayerColor(playerid, COLOR_RED);
SendClientMessage(playerid, COLOR_GREEN, "You change your color name to "yellow"Red");
return 1;
}
else if(strcmp(params, "6", true))
{
SetPlayerColor(playerid, COLOR_GREEN);
SendClientMessage(playerid, COLOR_GREEN, "You change your color name to "yellow"Green");
return 1;
}
else if(strcmp(params, "7", true))
{
SetPlayerColor(playerid, COLOR_BLUE);
SendClientMessage(playerid, COLOR_GREEN, "You change your color name to "yellow"Blue");
return 1;
}
else if(strcmp(params, "8", true))
{
SetPlayerColor(playerid, COLOR_PURPLE);
SendClientMessage(playerid, COLOR_GREEN, "You change your color name to "yellow"Purple");
return 1;
}
else if(strcmp(params, "9", true))
{
SetPlayerColor(playerid, COLOR_PINK);
SendClientMessage(playerid, COLOR_GREEN, "You change your color name to "yellow"Pink");
return 1;
}
else if(strcmp(params, "10", true))
{
SetPlayerColor(playerid, COLOR_VIOLET);
SendClientMessage(playerid, COLOR_GREEN, "You change your color name to "yellow"Violet");
return 1;
}
else if(strcmp(params, "randomcolor", true))
{
switch(color)
{
case 0: SetPlayerColor(playerid, COLOR_LIGHTBLUE);
case 1: SetPlayerColor(playerid, COLOR_LIGHTGREEN);
case 2: SetPlayerColor(playerid, COLOR_CYAN);
case 3: SetPlayerColor(playerid, COLOR_LIME);
case 4: SetPlayerColor(playerid, COLOR_BLUEGREEN);
case 5: SetPlayerColor(playerid, COLOR_BRIGHTRED);
case 6: SetPlayerColor(playerid, COLOR_GREENISHGOLD);
case 7: SetPlayerColor(playerid, COLOR_SEAGREEN);
case 8: SetPlayerColor(playerid, COLOR_VIOLET);
case 9: SetPlayerColor(playerid, COLOR_BROWN);
case 10: SetPlayerColor(playerid, COLOR_LIGHTCYAN);
case 11: SetPlayerColor(playerid, COLOR_LEMON);
}
format(string,sizeof(string),"You change your color name to "yellow"%s",color);
SendClientMessage(playerid,COLOR_GREEN,string);
return 1;
}
return 1;
}
CMD:setskin(playerid, params[])
{
new skin, skinid, pname[MAX_PLAYER_NAME], string[128];
skinid = GetPlayerSkin(playerid);
if(sscanf(params,"i", skin)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /setskin <0 - 299>");
if(skin == skinid) return SendClientMessage(playerid,COLOR_RED,"You already using that skin model");
if(skin > 299 || skin < 0) return SendClientMessage(playerid,COLOR_RED,"Invalid Skin ID! <0 - 299>");
GetPlayerName(playerid, pname,sizeof(pname));
format(string, sizeof(string),"%s has changed skin model to %i", pname,skin);
SendClientMessageToAll(COLOR_GREEN,string);
format(string, sizeof(string),"Your skin have been set to %d", skin);
SendClientMessage(playerid,COLOR_GREEN, string);
SetPlayerSkin(playerid, skin);
return 1;
}
CMD:kill(playerid,params[])
{
if(IsPlayerInArea(playerid, -381.318511, 1235.180419, -229.318511, 1379.180419)) return SendClientMessage(playerid,COLOR_RED,"You cannot commited suicide in Safe Zone");
SetPlayerHealth(playerid, 0);
return 1;
}
CMD:suicide(playerid,params[])
{
if(IsPlayerInArea(playerid, -381.318511, 1235.180419, -229.318511, 1379.180419)) return SendClientMessage(playerid,COLOR_RED,"You cannot commited suicide in Safe Zone");
SetPlayerHealth(playerid, 0);
return 1;
}
CMD:getinterior(playerid, params[])
{
new string[128],interior;
interior = GetPlayerInterior(playerid);
SendClientMessage(playerid,COLOR_WHITE,"===== "red"CURRENT INTERIOR "white"=====");
SendClientMessage(playerid,COLOR_WHITE," ");
format(string,sizeof(string),"Your now in interior "yellow"%d",interior);
SendClientMessage(playerid,COLOR_WHITE,string);
SendClientMessage(playerid,COLOR_WHITE," ");
SendClientMessage(playerid,COLOR_WHITE,"============================");
return 1;
}
CMD:playersonline(playerid, params[])
{
new str[156];
SendClientMessage(playerid,COLOR_WHITE,"===== "red"CURRENT ONLINE PLAYERS "white"=====");
SendClientMessage(playerid,COLOR_WHITE," ");
format(str, sizeof(str), "There is current %d players online in the server", counter);
SendClientMessage(playerid,COLOR_WHITE, str);
SendClientMessage(playerid,COLOR_WHITE," ");
SendClientMessage(playerid,COLOR_WHITE,"===================================");
return 1;
}
CMD:me(playerid, params[])
{
new string[128],msg[128],pname[MAX_PLAYER_NAME];
GetPlayerName(playerid,pname,sizeof(pname));
if(sscanf(params,"sz",msg)) return SendClientMessage(playerid,COLOR_RED, "USAGE: /me <text>");
format(string,sizeof(string),"*%s %s",pname,msg);
SendClientMessageToAll(COLOR_GREY,string);
return 1;
}
CMD:pm(playerid, params[])
{
new ID,message[128],str[128],pname[MAX_PLAYER_NAME],reciever[MAX_PLAYER_NAME];
if(sscanf(params,"us",ID,message)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /pm <playername/id> <msg>");
if(ID == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED,"ERROR: Invalid playerid!");
if(ID == playerid) return SendClientMessage(playerid,COLOR_RED,"ERROR: You cannot pm yourself!");
GetPlayerName(ID,reciever,sizeof(reciever));
GetPlayerName(playerid,pname,sizeof(pname));
if(togglepm[ID] == 0)
{
format(str,sizeof(str),"%s has tried to sent you a "yellow"PM",pname);
SendClientMessage(ID,COLOR_RED,str);
return SendClientMessage(playerid,COLOR_RED,"ERROR: That user has toggle his/her pm off");
}
format(str,sizeof(str),"PM Sent to %s(ID:%d): %s",reciever,ID,message);
SendClientMessage(playerid,COLOR_YELLOW,str);
format(str,sizeof(str),"PM Recieve From %s(ID:%d): %s",pname,playerid,message);
SendClientMessage(ID,COLOR_YELLOW,str);
PlayerPlaySound(ID,1085,0,0,0);
return 1;
}
CMD:nopm(playerid,params[])
{
if(togglepm[playerid] == 1)
{
SendClientMessage(playerid,COLOR_RED,"You turn your pm off now you cant recieve any "yellow"PM");
PlayerPlaySound(playerid,1085,0,0,0);
togglepm[playerid] = 0;
}
else if(togglepm[playerid] == 0)
{
SendClientMessage(playerid,COLOR_GREEN,"You turn your pm on now you can recieve a "yellow"PM");
PlayerPlaySound(playerid,1085,0,0,0);
togglepm[playerid] = 1;
}
return 1;
}