27.07.2013, 02:56
can someone give me the a to a /td (take drugs) amx and pwn filterscript?? or can someone Pleas make me one I have tried and tried but i get nothing.
CMD:takedrugs(playerid, params[]) {new giveplayerid; if(sscanf(params, "u", giveplayerid) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /takedrugs [playerid]"); PlayerInfo[giveplayerid][pHasDrugs] = 0; SendClientMessage(playerid, COLOR_WHITE, "You have taken the person's drugs."); SendClientMessage(giveplayerid, COLOR_WHITE, "Your drugs were taken."); return 1;}
// This is a comment // uncomment the line below if you want to write a filterscript //#define FILTERSCRIPT #include <a_samp> forward message(); #if defined FILTERSCRIPT public OnFilterScriptInit() { print("\n--------------------------------------"); print(" Blank Filterscript by your name here"); print("--------------------------------------\n"); return 1; } public OnFilterScriptExit() { return 1; } #else main() { print("\n************************************"); print("DM ADiD@S"); print("************************************\n"); } #endif public OnGameModeInit() { // Don't use these lines if it's a filterscript SetGameModeText("G.A.M.E - 2 Map(s)"); AddPlayerClass(1,1966.9421,1343.0248,16.6164,91.3507,0,0,0,0,0,0); // spawn1 AddPlayerClass(2,1966.9421,1343.0248,16.6164,91.3507,0,0,0,0,0,0); // spawn2 AddPlayerClass(146,1966.9421,1343.0248,16.6164,91.3507,0,0,0,0,0,0); // spawn3 AddPlayerClass(21,1966.9421,1343.0248,16.6164,91.3507,0,0,0,0,0,0); // spawn 4 AddPlayerClass(98,1966.9421,1343.0248,16.6164,91.3507,0,0,0,0,0,0); // spawn5 SendClientMessageToAll(0x33FF33AA, "Map: Grove Street By ADiD@S"); //CHNAGE_ME if you change map change Grove Street to map your map name and ic3_cr3am to the maps owners name CreateObject(8171,2387.6999500,1359.1999500,911.5999800,0.0000000,0.0000000,0.0000000); //object(vgssairportland06) (1) CreateObject(8171,2348.1001000,1359.0000000,911.5999800,0.0000000,0.0000000,0.0000000); //object(vgssairportland06) (2) CreateObject(8171,2308.1001000,1358.6999500,911.5999800,0.0000000,0.0000000,0.0000000); //object(vgssairportland06) (3) CreateObject(8171,2268.1999500,1358.9000200,911.5999800,0.0000000,0.0000000,0.0000000); //object(vgssairportland06) (4) CreateObject(8171,2228.3999000,1358.6999500,911.5999800,0.0000000,0.0000000,0.0000000); //object(vgssairportland06) (5) CreateObject(8171,2188.3999000,1359.0000000,911.5999800,0.0000000,0.0000000,0.0000000); //object(vgssairportland06) (6) CreateObject(8171,2148.3999000,1358.6999500,911.5999800,0.0000000,0.0000000,0.0000000); //object(vgssairportland06) (7) CreateObject(8171,2108.5000000,1358.4000200,911.5999800,0.0000000,0.0000000,0.0000000); //object(vgssairportland06) (8) CreateObject(8171,2068.6999500,1358.0999800,911.5999800,0.0000000,0.0000000,0.0000000); //object(vgssairportland06) (9) CreateObject(8171,2028.9000200,1358.3000500,911.5999800,0.0000000,0.0000000,0.0000000); //object(vgssairportland06) (10) CreateObject(8171,1989.4000200,1358.6999500,911.5999800,0.0000000,0.0000000,0.0000000); //object(vgssairportland06) (11) CreateObject(8171,2387.5000000,1221.1999500,911.5999800,0.0000000,0.0000000,0.0000000); //object(vgssairportland06) (13) CreateObject(8171,2348.1001000,1220.6999500,911.5999800,0.0000000,0.0000000,0.0000000); //object(vgssairportland06) (12) CreateObject(8171,2308.1999500,1221.3000500,911.5999800,0.0000000,0.0000000,0.0000000); //object(vgssairportland06) (14) CreateObject(8171,2268.5000000,1221.1999500,911.5999800,0.0000000,0.0000000,0.0000000); //object(vgssairportland06) (15) CreateObject(8171,2228.3999000,1220.5999800,911.5999800,0.0000000,0.0000000,0.0000000); //object(vgssairportland06) (16) CreateObject(8171,2188.3999000,1221.0000000,911.5999800,0.0000000,0.0000000,0.0000000); //object(vgssairportland06) (17) CreateObject(8171,2148.6999500,1220.4000200,911.5999800,0.0000000,0.0000000,0.0000000); //object(vgssairportland06) (18) CreateObject(8171,2108.8000500,1220.5000000,911.5999800,0.0000000,0.0000000,0.0000000); //object(vgssairportland06) (19) CreateObject(8171,2068.8000500,1221.0999800,911.5999800,0.0000000,0.0000000,0.0000000); //object(vgssairportland06) (20) CreateObject(8171,2029.0999800,1220.1999500,911.5999800,0.0000000,0.0000000,0.0000000); //object(vgssairportland06) (21) CreateObject(8171,1989.1999500,1220.8000500,911.5999800,0.0000000,0.0000000,0.0000000); //object(vgssairportland06) (22) CreateObject(4882,2069.3999000,1298.9000200,916.5000000,0.0000000,0.0000000,90.0000000); //object(lasbrid1_las) (1) CreateObject(7245,1890.4000200,1177.0000000,901.0999800,0.0000000,0.0000000,270.0000000); //object(vegasnbank1ug) (1) CreateObject(3491,2373.0000000,1399.8000500,920.0999800,0.0000000,0.0000000,0.0000000); //object(vegass_hanger2) (1) CreateObject(3887,1961.3000500,1215.5000000,919.7999900,0.0000000,0.0000000,180.0000000); //object(demolish4_sfxrf) (1) CreateObject(8171,1949.5999800,1257.6999500,911.5999800,0.0000000,0.0000000,0.0000000); //object(vgssairportland06) (23) CreateObject(5710,1906.1999500,1209.9000200,917.0999800,0.0000000,0.0000000,0.0000000); //object(cem01_law) (1) CreateObject(8171,1909.6999500,1258.0999800,911.5999800,0.0000000,0.0000000,0.0000000); //object(vgssairportland06) (24) CreateObject(5716,1921.0999800,1170.9000200,924.9000200,0.0000000,0.0000000,180.0000000); //object(manns01_lawn) (1) CreateObject(8493,1927.4000200,1282.9000200,926.0000000,0.0000000,25.0000000,112.0000000); //object(pirtshp01_lvs) (1) CreateObject(11427,1906.5000000,1237.9000200,918.7999900,0.0000000,0.0000000,176.0000000); //object(des_adobech) (1) CreateObject(13295,1894.5999800,1268.8000500,918.2000100,0.0000000,0.0000000,328.0000000); //object(ce_terminal1) (1) CreateObject(16770,1964.5000000,1307.4000200,913.2000100,0.0000000,0.0000000,180.0000000); //object(des_gunbldg01) (1) CreateObject(16770,1964.4000200,1319.4000200,913.2000100,0.0000000,0.0000000,179.9950000); //object(des_gunbldg01) (2) CreateObject(5409,1980.3000500,1169.4000200,916.0999800,0.0000000,0.0000000,0.0000000); //object(laepetrol1a) (1) CreateObject(1676,2003.1999500,1170.0999800,913.2999900,0.0000000,0.0000000,90.0000000); //object(washgaspump) (1) CreateObject(1676,2003.3000500,1167.9000200,913.2999900,0.0000000,0.0000000,90.0000000); //object(washgaspump) (2) CreateObject(1676,2003.1999500,1175.4000200,913.2999900,0.0000000,0.0000000,90.0000000); //object(washgaspump) (3) CreateObject(1676,2003.1999500,1177.9000200,913.2999900,0.0000000,0.0000000,90.0000000); //object(washgaspump) (4) CreateObject(8171,2540.0000000,-1679.4000200,32.4000000,0.0000000,90.0000000,180.0000000); //object(vgssairportland06) (25) CreateObject(8171,2471.8000500,-1631.5000000,32.4000000,0.0000000,90.0000000,271.9950000); //object(vgssairportland06) (26) CreateObject(8171,2420.6001000,-1667.6999500,32.4000000,0.0000000,90.0000000,359.9940000); //object(vgssairportland06) (27) CreateObject(8171,2474.3000500,-1732.0999800,32.4000000,0.0000000,90.0000000,89.9890000); //object(vgssairportland06) (28) CreateObject(3359,2428.1001000,-1640.5999800,26.3000000,0.0000000,0.0000000,182.0000000); //object(cxrf_savhusgar1_) (1) return 1; } public message() { SendClientMessageToAll(0x375FFFFF, "The next map will be BAY SIDE."); //SendClientMessageToAll(0x375FFFFF, "The next map will be example"); SendRconCommand("changemode PB1"); //SendRconCommand("changemode example"); CHNAGE_ME change PB1 to ur gamemode } public OnGameModeExit() { return 1; } public OnPlayerRequestClass(playerid, classid) { SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746); SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746); SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746); return 1; } public OnPlayerConnect(playerid) { new pname[MAX_PLAYER_NAME], string[22 + MAX_PLAYER_NAME]; GetPlayerName(playerid, pname, sizeof(pname)); format(string, sizeof(string), ">BEWZ: %s has joined the server", pname); SendClientMessageToAll(0xAAAAAAAA, string); return 1; } public OnPlayerDisconnect(playerid, reason) { new pname[MAX_PLAYER_NAME], string[22 + MAX_PLAYER_NAME]; GetPlayerName(playerid, pname, sizeof(pname)); format(string, sizeof(string), ">RIP: %s has left the server", pname); SendClientMessageToAll(0xAAAAAAAA, string); return 1; } public OnPlayerSpawn(playerid) { // now this is the random spawn part -coming soon new rand = random(4); // 4 = number of spawns you want { if(rand == 0)//spawn 0 { SetPlayerPos(playerid, 2464.9995, -1714.9498, 13.5001); } if(rand == 1)//spawn 1 { SetPlayerPos(playerid, 2508.8445, -1688.6021, 13.5333); } if(rand == 2)//" { SetPlayerPos(playerid, 2512.1296, -1650.9603, 13.9422); } if(rand == 3)//" { SetPlayerPos(playerid, 2454.5354, -1676.2017, 13.5018); } if(rand == 4)//" { SetPlayerPos(playerid, 2434.2197, -1644.0834, 13.4994 ); } //if you want more spawns just copy and paste //------------------------------------------------- //if(rand == 4)//change 4 to 5 //{ //SetPlayerPos(playerid, and ); //} //----------------------------------- GivePlayerWeapon(playerid, 9, 99999999); GivePlayerWeapon(playerid, 24, 99999999); GivePlayerWeapon(playerid, 26, 99999999); GivePlayerWeapon(playerid, 28, 99999999); GivePlayerWeapon(playerid, 31, 99999999); SetPlayerHealth(playerid, 100); SetPlayerArmour(playerid, 100); return 1; } } public OnPlayerDeath(playerid, killerid, reason) { SendDeathMessage(killerid, playerid, reason); SetPlayerScore(killerid,GetPlayerScore(killerid)+1);//CHANGE_ME change 1 to the the number of score the killer must get GivePlayerMoney(killerid, random(10000)); // 10000 it the money that the killer will get but it will be random 0-500 GivePlayerMoney(playerid, -random(5000)); //5000 is the money player that died looses its random return 1; } public OnVehicleSpawn(vehicleid) { return 1; } public OnVehicleDeath(vehicleid, killerid) { return 1; } public OnPlayerText(playerid, text[]) { return 1; } public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/ad", cmdtext, true, 10) == 0) { SetPlayerHealth(playerid, 100); return 1; } return 0; } public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { return 1; } public OnPlayerExitVehicle(playerid, vehicleid) { return 1; } public OnPlayerStateChange(playerid, newstate, oldstate) { return 1; } 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 OnPlayerRequestSpawn(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) { 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; }
CMD:givemedrugs(playerid, params[])
{ SendClientMessage(playerid, -1,"You have received 1 drugs"); PlayerInfo[playerid][pHasDrugs]++; return 1; } CMD:takedrugs(playerid, params[]) { if(PlayerInfo[playerid][pHasDrugs] >= 1) { UseDrugs1[playerid] = SetTimerEx("UseDrugs", 1000, true, "i", playerid); SetTimer("KillUseDrugs", 50000, false); } else if(PlayerInfo[playerid][pHasDrugs] >= 0) { SendClientMessage(playerid, COL_RED,"You do not have any drugs."); } return 1; } forward KillUseDrugs(playerid); public KillUseDrugs(playerid) { KillTimer(UseDrugs1[playerid]); return 1; } forward UseDrugs(playerid); public UseDrugs(playerid) { new Float:health; GetPlayerHealth(playerid,health); if (health < 10.0) { SetPlayerHealth(playerid, 20.0); } else if (health > 20.0) { SetPlayerHealth(playerid, 25.0); } else if (health > 25.0) { SetPlayerHealth(playerid, 30.0); } else if (health > 30.0) { SetPlayerHealth(playerid, 35.0); } else if (health > 35.0) { SetPlayerHealth(playerid, 40.0); } else if (health > 40.0) { SetPlayerHealth(playerid, 45.0); } else if (health > 45.0) { SetPlayerHealth(playerid, 50.0); } else if (health > 50.0) { SetPlayerHealth(playerid, 55.0); } else if (health > 55.0) { SetPlayerHealth(playerid, 60.0); } else if (health > 60.0) { SetPlayerHealth(playerid, 65.0); } else if (health > 65.0) { SetPlayerHealth(playerid, 70.0); } else if (health > 70.0) { SetPlayerHealth(playerid, 75.0); } else if (health > 75.0) { SetPlayerHealth(playerid, 80.0); } else if (health > 80.0) { SetPlayerHealth(playerid, 85.0); } else if (health > 85.0) { SetPlayerHealth(playerid, 90.0); } else if (health > 90.0) { SetPlayerHealth(playerid, 95.0); } else if (health > 95.0) { SetPlayerHealth(playerid, 100.0); } return 1; } |
new Float:health;
GetPlayerHealth(playerid, health);
SetPlayerHealth(playerid, health+5);
public OnPlayerSpawn(playerid)
{
//codes
return 1;
}
CMD:...........
public UseDrugs(playerid)
{
new Float:health;
GetPlayerHealth(playerid,health);
if (health < 10.0)
{
SetPlayerHealth(playerid, 20.0);
}
else if (health > 20.0)
{
SetPlayerHealth(playerid, 25.0);
}
else if (health > 25.0)
{
SetPlayerHealth(playerid, 30.0);
}
else if (health > 30.0)
{
SetPlayerHealth(playerid, 35.0);
}
else if (health > 35.0)
{
SetPlayerHealth(playerid, 40.0);
}
else if (health > 40.0)
{
SetPlayerHealth(playerid, 45.0);
}
else if (health > 45.0)
{
SetPlayerHealth(playerid, 50.0);
}
else if (health > 50.0)
{
SetPlayerHealth(playerid, 55.0);
}
else if (health > 55.0)
{
SetPlayerHealth(playerid, 60.0);
}
else if (health > 60.0)
{
SetPlayerHealth(playerid, 65.0);
}
else if (health > 65.0)
{
SetPlayerHealth(playerid, 70.0);
}
else if (health > 70.0)
{
SetPlayerHealth(playerid, 75.0);
}
else if (health > 75.0)
{
SetPlayerHealth(playerid, 80.0);
}
else if (health > 80.0)
{
SetPlayerHealth(playerid, 85.0);
}
else if (health > 85.0)
{
SetPlayerHealth(playerid, 90.0);
}
else if (health > 90.0)
{
SetPlayerHealth(playerid, 95.0);
}
else if (health > 95.0)
{
SetPlayerHealth(playerid, 100.0);
}
return 1;
}
new Float:health;
GetPlayerHealth(playerid,health);
if (health > 0)
{
SetPlayerHealth(playerid, health + 5);
}