SAMP Gitlab CI Test
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1952 lines
61 KiB

5 years ago
  1. //-------------------------------------------------
  2. //
  3. // SA-MP 0.3+ commands for internal testing.
  4. // These were left in the distribution in case
  5. // anyone found the snippets useful for their
  6. // own scripts.
  7. // Don't load this script on a public server
  8. // as it could break your existing scripts.
  9. // Kye 2009-2015
  10. //
  11. //-------------------------------------------------
  12. #pragma tabsize 0
  13. #include <a_samp>
  14. #include <core>
  15. #include <float>
  16. #include "../include/gl_common.inc"
  17. new Text3D:textid;
  18. new PlayerText3D:player3dtextid;
  19. new savanna=0;
  20. new blade=0;
  21. new fence=0;
  22. new unfreezeplayer=0;
  23. new testlbplayer=0;
  24. new edit_objectid = INVALID_OBJECT_ID;
  25. new vehicleid_tokill = 0;
  26. // For testing text material/texture replacements
  27. new test_tex_objects[128];
  28. new text_counter = 0;
  29. new text_update_timer = -1;
  30. new text_update_player = INVALID_PLAYER_ID;
  31. forward UnFreezeMe();
  32. forward ShowTestDialog();
  33. forward TimedVehicleDeath();
  34. forward UpdateTextTimer();
  35. #define AMMUNATION_SMGS_DIALOG "\
  36. Weapon\tAmount\tPrice\n\
  37. {FFFFFF}MP5\t90\t{FF0000}$3500\
  38. "
  39. new Text:txtSpriteTest[5];
  40. new test_actor_id = INVALID_ACTOR_ID;
  41. //-------------------------------------------------
  42. SpawnVehicle_InfrontOfPlayer(playerid, vehiclemodel, color1, color2)
  43. {
  44. new Float:x,Float:y,Float:z;
  45. new Float:facing;
  46. new Float:distance;
  47. GetPlayerPos(playerid, x, y, z);
  48. GetPlayerFacingAngle(playerid, facing);
  49. new Float:size_x,Float:size_y,Float:size_z;
  50. GetVehicleModelInfo(vehiclemodel, VEHICLE_MODEL_INFO_SIZE, size_x, size_y, size_z);
  51. distance = size_x + 0.5;
  52. x += (distance * floatsin(-facing, degrees));
  53. y += (distance * floatcos(-facing, degrees));
  54. facing += 90.0;
  55. if(facing > 360.0) facing -= 360.0;
  56. return CreateVehicle(vehiclemodel, x, y, z + (size_z * 0.25), facing, color1, color2, -1);
  57. }
  58. //-------------------------------------------------
  59. stock CreateExplosionEx(Float:X, Float:Y, Float:Z, type, Float:Radius, virtualworld)
  60. {
  61. new x;
  62. while(x != MAX_PLAYERS) {
  63. if(IsPlayerConnected(x)) {
  64. if(virtualworld == -1 || virtualworld == GetPlayerVirtualWorld(x)) {
  65. CreateExplosionForPlayer(x, X, Y, Z, type, Radius);
  66. }
  67. }
  68. x++;
  69. }
  70. }
  71. //-------------------------------------------------
  72. public UnFreezeMe()
  73. {
  74. TogglePlayerControllable(unfreezeplayer,1);
  75. }
  76. //-------------------------------------------------
  77. public ShowTestDialog()
  78. {
  79. new listitems[] = "{FFFFFF}1\t{55EE55}Deagle\n{FFFFFF}2\t{55EE55}Sawnoff\n{FFFFFF}3\t{55EE55}Pistol\n{FFFFFF}4\t{55EE55}Grenade\n{FFFFFF}5\t{55EE55}Parachute\n6\t{55EE55}Lorikeet";
  80. ShowPlayerDialog(testlbplayer,2,DIALOG_STYLE_LIST,"{448844}List of weapons:",listitems,"Select","Cancel");
  81. }
  82. //-------------------------------------------------
  83. TabListDialogTest(playerid)
  84. {
  85. new listitems[] =
  86. "Deagle\t$5000\t100\n" \
  87. "Sawnoff\t$5000\t100\n" \
  88. "Pistol\t$1000\t50\n" \
  89. "M4\t$10000\t100\n" \
  90. "MP5\t$7500\t200\n" \
  91. "Grenade\t$500\t1\n" \
  92. "Parachute\t$10000\t1\n" \
  93. "Lorikeet\t$50000\t500\n";
  94. ShowPlayerDialog(playerid,2,DIALOG_STYLE_TABLIST,"Buy Weapon",listitems,"Select","Cancel");
  95. }
  96. //-------------------------------------------------
  97. TabListHeadersDialogTest(playerid)
  98. {
  99. new listitems[] =
  100. "Weapon\tPrice\tAmmo\n" \
  101. "Deagle\t$5000\t100\n" \
  102. "Sawnoff\t$5000\t100\n" \
  103. "Pistol\t$1000\t50\n" \
  104. "M4\t$10000\t100\n" \
  105. "MP5\t$7500\t200\n" \
  106. "Grenade\t$500\t1\n" \
  107. "Parachute\t$10000\t1\n" \
  108. "Lorikeet\t$50000\t500\n";
  109. ShowPlayerDialog(playerid,2,DIALOG_STYLE_TABLIST_HEADERS,"Buy Weapon",listitems,"Select","Cancel");
  110. }
  111. //-------------------------------------------------
  112. public TimedVehicleDeath()
  113. {
  114. if(vehicleid_tokill > 0) {
  115. DestroyVehicle(vehicleid_tokill);
  116. }
  117. }
  118. //-------------------------------------------------
  119. public UpdateTextTimer()
  120. {
  121. new textdisp[256+1];
  122. format(textdisp,256,"Dynamic Update (%d)", text_counter);
  123. text_counter++;
  124. SetPlayerObjectMaterialText(text_update_player, test_tex_objects[0], textdisp, 0, OBJECT_MATERIAL_SIZE_512x128, "Courier New", 48, 1, 0xFF000000, 0, 0);
  125. }
  126. //-------------------------------------------------
  127. public OnPlayerCommandText(playerid, cmdtext[])
  128. {
  129. new cmd[256+1];
  130. new idx;
  131. cmd = strtok(cmdtext, idx);
  132. new engine,lights,alarm,doors,bonnet,boot,objective;
  133. //if(!IsPlayerAdmin(playerid)) return 0; // this is an admin only script
  134. if(strcmp(cmd, "/player2v", true) == 0)
  135. {
  136. new tmp[256];
  137. new tmp2[256];
  138. tmp = strtok(cmdtext,idx);
  139. tmp2 = strtok(cmdtext,idx);
  140. PutPlayerInVehicle(strval(tmp),strval(tmp2),0);
  141. return 1;
  142. }
  143. if(strcmp( cmd, "/vc", true ) == 0 )
  144. {
  145. new tmp[256];
  146. new created_vehicle_id;
  147. tmp = strtok( cmdtext, idx );
  148. created_vehicle_id = SpawnVehicle_InfrontOfPlayer(playerid, strval(tmp), -1, -1);
  149. new msg[128+1];
  150. format(msg,128,"Created vehicle: %d",created_vehicle_id);
  151. SendClientMessage(playerid,0xAAAAAAAA,msg);
  152. return 1;
  153. }
  154. if(strcmp( cmd, "/weap", true ) == 0 )
  155. {
  156. new tmp[256];
  157. tmp = strtok( cmdtext, idx );
  158. GivePlayerWeapon(playerid, strval(tmp), 9999);
  159. return 1;
  160. }
  161. if(strcmp( cmd, "/dvehicle", true ) == 0 )
  162. {
  163. new tmp[256];
  164. tmp = strtok( cmdtext, idx );
  165. DestroyVehicle( strval(tmp) );
  166. new msg[256];
  167. format(msg,256,"Destroyed vehicle: %d",strval(tmp));
  168. SendClientMessage(playerid,0xAAAAAAAA,msg);
  169. return 1;
  170. }
  171. if(strcmp( cmd, "/goto", true ) == 0)
  172. {
  173. new tmp[256];
  174. tmp = strtok(cmdtext,idx);
  175. if(!strlen(tmp)) { return 1; }
  176. new Float:X, Float:Y, Float:Z;
  177. if(GetPlayerVehicleID(playerid))
  178. {
  179. GetPlayerPos( strval(tmp), X, Y, Z );
  180. SetVehiclePos( GetPlayerVehicleID(playerid), X+2, Y+2, Z );
  181. } else {
  182. GetPlayerPos( strval(tmp), X, Y, Z );
  183. SetPlayerPos( playerid, X+2, Y+2, Z );
  184. }
  185. return 1;
  186. }
  187. if(strcmp(cmd, "/bring", true) == 0)
  188. {
  189. new tmp[256];
  190. tmp = strtok(cmdtext, idx);
  191. if(!strlen(tmp)) { return 1; }
  192. new Float:X, Float:Y, Float:Z;
  193. if(GetPlayerVehicleID(strval(tmp)))
  194. {
  195. GetPlayerPos(playerid, X, Y, Z);
  196. SetVehiclePos(GetPlayerVehicleID(strval(tmp)), X+2, Y+2, Z);
  197. } else {
  198. GetPlayerPos(playerid, X, Y, Z);
  199. SetPlayerPos(strval(tmp), X+2, Y+2, Z);
  200. }
  201. return 1;
  202. }
  203. if(strcmp(cmd, "/me2v", true) == 0)
  204. {
  205. new tmp[256];
  206. tmp = strtok(cmdtext,idx);
  207. PutPlayerInVehicle(playerid,strval(tmp),0);
  208. return 1;
  209. }
  210. if(strcmp(cmd, "/tpzero", true) == 0)
  211. {
  212. new vid = GetPlayerVehicleID(playerid);
  213. if(vid != INVALID_VEHICLE_ID) {
  214. SetVehiclePos(vid,0.0,0.0,10.0);
  215. }
  216. return 1;
  217. }
  218. if(strcmp(cmd, "/myvw", true) == 0)
  219. {
  220. new tmp[256];
  221. tmp = strtok(cmdtext,idx);
  222. SetPlayerVirtualWorld(playerid,strval(tmp));
  223. return 1;
  224. }
  225. if(strcmp( cmd, "/fight", true ) == 0)
  226. {
  227. new tmp[256];
  228. new name[128];
  229. tmp = strtok(cmdtext, idx);
  230. new style = strval(tmp);
  231. SetPlayerFightingStyle(playerid, style);
  232. GetPlayerName(playerid,name,128);
  233. format(tmp, 256, "(%s) fighting style changed to %d", name, style);
  234. SendClientMessageToAll(0x4499CCFF,tmp);
  235. return 1;
  236. }
  237. if(strcmp( cmd, "/myfacingangle", true ) == 0)
  238. {
  239. new Float:angle;
  240. new tmp[256];
  241. GetPlayerFacingAngle(playerid,angle);
  242. format(tmp, 256, "Facing: %f",angle);
  243. SendClientMessage(playerid,0x4499CCFF,tmp);
  244. return 1;
  245. }
  246. if(strcmp(cmd, "/crime", true) == 0) {
  247. new tmp[256];
  248. new tmp2[256];
  249. tmp = strtok(cmdtext,idx);
  250. tmp2 = strtok(cmdtext,idx);
  251. PlayCrimeReportForPlayer(playerid, strval(tmp), strval(tmp2));
  252. return 1;
  253. }
  254. if(strcmp(cmd, "/repairmycar", true) == 0) {
  255. new vid = GetPlayerVehicleID(playerid);
  256. if (vid) RepairVehicle(vid);
  257. return 1;
  258. }
  259. if(strcmp(cmd, "/bv", true) == 0)
  260. {
  261. new tmp[128], iCar, string[128];
  262. tmp = strtok(cmdtext, idx);
  263. if(strlen(tmp) == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "DO: /bv [vehicleid]");
  264. iCar = strval(tmp);
  265. new File:file = fopen("badvehicles.txt",io_append);
  266. format(string,sizeof(string),"%d\r\n", iCar);
  267. fwrite(file,string);
  268. fclose(file);
  269. GetPlayerName(playerid,tmp,128);
  270. format(string, sizeof(string), "Veh ID %i marked as bad vehicle by %s", iCar, tmp);
  271. SendClientMessageToAll(0xFFFFFFFF, string);
  272. return 1;
  273. }
  274. if(strcmp(cmd, "/weapskill", true) == 0) {
  275. new tmp[256];
  276. new tmp2[256];
  277. tmp = strtok(cmdtext,idx);
  278. tmp2 = strtok(cmdtext,idx);
  279. SetPlayerSkillLevel(playerid, strval(tmp), strval(tmp2));
  280. return 1;
  281. }
  282. if(strcmp(cmd, "/labelonvehicle", true) == 0) {
  283. new vid = GetPlayerVehicleID(playerid);
  284. textid = Create3DTextLabel("My Vehicle\nOwned by me\nNo Fuel\nRunning on vapour",0xEEEEEE50,0.0,0.0,0.0,15.0,0);
  285. Attach3DTextLabelToVehicle(textid, vid, 0.0, -1.6, -0.35); // tail of the vehicle toward the ground
  286. return 1;
  287. }
  288. if(strcmp(cmd, "/labelonplayer", true) == 0) {
  289. new tmp[256];
  290. tmp = strtok(cmdtext,idx);
  291. textid = Create3DTextLabel("Player Label",0xFFFFFFFF,0.0,0.0,0.0,40.0,0);
  292. Attach3DTextLabelToPlayer(textid, strval(tmp), 0.0, 0.0, -0.4);
  293. return 1;
  294. }
  295. if(strcmp(cmd, "/manylabels", true) == 0) {
  296. new Float:X, Float:Y, Float:Z;
  297. GetPlayerPos(playerid, X, Y, Z);
  298. new x=0;
  299. while(x!=50) {
  300. Create3DTextLabel("Mah Labels",0xFFFFFFFF,X,Y,Z,100.0,0);
  301. Z = Z + 0.1;
  302. x++;
  303. }
  304. return 1;
  305. }
  306. if(strcmp(cmd, "/dellabel", true) == 0) {
  307. Delete3DTextLabel(textid);
  308. return 1;
  309. }
  310. if(strcmp(cmd, "/playerlabel", true) == 0) {
  311. new Float:X, Float:Y, Float:Z;
  312. GetPlayerPos( playerid, X, Y, Z );
  313. player3dtextid = CreatePlayer3DTextLabel(playerid,"Hello\nI'm at your position",0x008080FF,X,Y,Z,40.0);
  314. SendClientMessage(playerid, 0xFFFFFFFF, "I created a player label at your position.");
  315. return 1;
  316. }
  317. if(strcmp(cmd, "/playerlabelveh", true) == 0) {
  318. new vid = GetPlayerVehicleID(playerid);
  319. player3dtextid = CreatePlayer3DTextLabel(playerid,"im in your vehicles\nand hiding behind the walls",0x008080FF,0.0,-1.6,-0.35,20.0,INVALID_PLAYER_ID,vid,1);
  320. return 1;
  321. }
  322. if(strcmp(cmd, "/playerlabelpl", true) == 0) {
  323. new tmp[256];
  324. tmp = strtok(cmdtext,idx);
  325. player3dtextid = CreatePlayer3DTextLabel(playerid,"Hello Testing",0x008080FF,0.0,0.0,0.0,30.0,strval(tmp));
  326. return 1;
  327. }
  328. if(strcmp(cmd, "/delplayerlabel", true) == 0) {
  329. DeletePlayer3DTextLabel(playerid, player3dtextid);
  330. return 1;
  331. }
  332. if(strcmp(cmd, "/updateplayerlabel", true) == 0) {
  333. UpdatePlayer3DTextLabelText(playerid, player3dtextid, 0xFFFFFFFF, "");
  334. return 1;
  335. }
  336. if(strcmp(cmd, "/carmodtest", true) == 0) {
  337. // spawns a couple of cars in Grove with mods applied
  338. savanna = CreateVehicle(567,2509.1343,-1686.2330,13.2296,47.3679,16,16,10000);
  339. AddVehicleComponent(savanna,1189); //Front Bumper
  340. AddVehicleComponent(savanna,1187); //Rear Bumper
  341. AddVehicleComponent(savanna,1129); //Exhaust
  342. AddVehicleComponent(savanna,1102); //Left Side Skirt
  343. AddVehicleComponent(savanna,1133); //Right Side Skirt
  344. AddVehicleComponent(savanna,1078); //Wheels
  345. AddVehicleComponent(savanna,1010); //Nitro 10x
  346. AddVehicleComponent(savanna,1087); //Hydrolics
  347. blade = CreateVehicle(536,2509.8462,-1671.8666,13.1510,348.3512,16,16,10000);
  348. AddVehicleComponent(blade,1182); //Front Bumper
  349. AddVehicleComponent(blade,1184); //Rear Bumper
  350. AddVehicleComponent(blade,1104); //Exhaust
  351. AddVehicleComponent(blade,1108); //Left Side Skirt
  352. AddVehicleComponent(blade,1107); //Right Side Skirt
  353. AddVehicleComponent(blade,1078); //Wheels
  354. AddVehicleComponent(blade,1010); //Nitro 10x
  355. AddVehicleComponent(blade,1087); //Hydrolics
  356. return 1;
  357. }
  358. if(strcmp(cmd, "/addnitro", true) == 0) {
  359. new vid = GetPlayerVehicleID(playerid);
  360. AddVehicleComponent(vid, 1010);
  361. return 1;
  362. }
  363. if(strcmp(cmd, "/remnitro", true) == 0) {
  364. new vid = GetPlayerVehicleID(playerid);
  365. RemoveVehicleComponent(vid, 1010);
  366. return 1;
  367. }
  368. if(strcmp(cmd, "/paintjob", true) == 0) {
  369. new tmp[256];
  370. tmp = strtok(cmdtext,idx);
  371. new vid = GetPlayerVehicleID(playerid);
  372. ChangeVehiclePaintjob(vid,strval(tmp));
  373. return 1;
  374. }
  375. if(strcmp(cmd, "/longtd", true) == 0) {
  376. new st4[256];
  377. new st5[256];
  378. new st6[256];
  379. new st7[1024];
  380. format(st4,sizeof(st4),"0123456789012345678901234567890123456789~n~012345678901234567890123456789~n~01234567890123456789~n~0123456789~n~0123456789012345678901234567890123456789~n~01234567890123456789~n~01234567890123456789~n~01234567890123456789~n~");
  381. format(st5,sizeof(st5),"0123456789012345678901234567890123456789~n~012345678901234567890123456789~n~01234567890123456789~n~0123456789~n~0123456789012345678901234567890123456789~n~01234567890123456789~n~01234567890123456789~n~01234567890123456789~n~");
  382. format(st6,sizeof(st6),"0123456789012345678901234567890123456789~n~012345678901234567890123456789~n~01234567890123456789~n~0123456789~n~0123456789012345678901234567890123456789~n~01234567890123456789~n~01234567890123456789~n~01234567890123456789");
  383. format(st7,sizeof(st7),"%s %s %s~n~LEN(%d)",st4,st5,st6,strlen(st4)+strlen(st5)+strlen(st6));
  384. new Text:Stats = TextDrawCreate(10.0, 10.0, st7);
  385. TextDrawTextSize(Stats, 400.0, 400.0);
  386. TextDrawUseBox(Stats,0);
  387. TextDrawBoxColor(Stats,0xFFFFFFFF);
  388. TextDrawFont(Stats,1);
  389. TextDrawLetterSize(Stats,0.5,0.5);
  390. TextDrawShowForPlayer(playerid,Stats);
  391. return 1;
  392. }
  393. if(strcmp(cmd, "/testmsgbox", true) == 0) {
  394. ShowPlayerDialog(playerid,0,DIALOG_STYLE_MSGBOX,"Welcome","Welcome to the SA-MP 0.3 server. This is test_cmds.pwn /testmsgbox\nHope it's useful to you.","OK","");
  395. return 1;
  396. }
  397. if(strcmp(cmd, "/testmsgbox2", true) == 0) {
  398. ShowPlayerDialog(playerid,0,DIALOG_STYLE_MSGBOX,"Welcome","Welcome:\tInfo\nTest:\t\tTabulated\nLine:\t\tHello","OK","Cancel");
  399. return 1;
  400. }
  401. if(strcmp(cmd, "/testinputbox", true) == 0) {
  402. new loginmsg[256+1];
  403. new loginname[MAX_PLAYER_NAME+1];
  404. GetPlayerName(playerid,loginname,MAX_PLAYER_NAME);
  405. format(loginmsg,256,"Welcome to the SA-MP 0.3 server.\n\n{EEEE88}Account:\t{FFFFFF}%s\n\n{FFFFFF}Please enter your password below:",loginname);
  406. ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"{EE7777}Login to SA-MP",loginmsg,"Login","Cancel");
  407. return 1;
  408. }
  409. if(strcmp(cmd, "/testpassbox", true) == 0) {
  410. new loginmsg[256+1];
  411. new loginname[MAX_PLAYER_NAME+1];
  412. GetPlayerName(playerid,loginname,MAX_PLAYER_NAME);
  413. format(loginmsg,256,"Welcome to the SA-MP 0.3 server.\n\n{EEEE88}Account:\t{FFFFFF}%s\n\n{FFFFFF}Please enter your password below:",loginname);
  414. ShowPlayerDialog(playerid,1,DIALOG_STYLE_PASSWORD,"{EE7777}Login to SA-MP",loginmsg,"Login","Cancel");
  415. return 1;
  416. }
  417. if(strcmp(cmd, "/testlistbox", true) == 0) {
  418. new listitems[] = "{FFFFFF}1\t{55EE55}Deagle\n{FFFFFF}2\t{55EE55}Sawnoff\n{FFFFFF}3\t{55EE55}Pistol\n{FFFFFF}4\t{55EE55}Grenade\n{FFFFFF}5\t{55EE55}Parachute\n6\t{55EE55}Lorikeet";
  419. ShowPlayerDialog(playerid,2,DIALOG_STYLE_LIST,"{448844}List of weapons:",listitems,"Select","Cancel");
  420. return 1;
  421. }
  422. if(strcmp(cmd, "/testtablist", true) == 0) {
  423. TabListDialogTest(playerid);
  424. return 1;
  425. }
  426. if(strcmp(cmd, "/testtablistheaders", true) == 0) {
  427. TabListHeadersDialogTest(playerid);
  428. return 1;
  429. }
  430. if(strcmp(cmd, "/testtablistcrash", true) == 0) {
  431. //ShowPlayerDialog(playerid,2,DIALOG_STYLE_TABLIST_HEADERS,"{FFFF00}SMGs", "Weapon\tAmount\tPrice\n{FFFFFF}MP5\t90\t{FF0000}$3500","Buy", "Go Back");
  432. ShowPlayerDialog(playerid,2,DIALOG_STYLE_TABLIST_HEADERS,"{FFFF00}SMGs", AMMUNATION_SMGS_DIALOG, "Buy", "Go Back");
  433. return 1;
  434. }
  435. if(strcmp(cmd, "/testclosebox", true) == 0) {
  436. ShowPlayerDialog(playerid,-1,0,"","","","");
  437. return 1;
  438. }
  439. if(strcmp(cmd, "/setfacingzero", true) == 0) {
  440. SetPlayerFacingAngle(playerid, 0.0);
  441. return 1;
  442. }
  443. if(strcmp(cmd, "/detachtrailer", true) == 0) {
  444. new vid = GetPlayerVehicleID(playerid);
  445. DetachTrailerFromVehicle(vid);
  446. return 1;
  447. }
  448. if(strcmp(cmd, "/testformat", true) == 0) {
  449. new strtest[256];
  450. new File:f = fopen("test.txt",io_write);
  451. format(strtest,256,"[chat] %d %s\r\n",24,"����");
  452. SendClientMessage(playerid,0xFFFFFFFF,strtest);
  453. fwrite(f,strtest);
  454. format(strtest,256,"[chat] %d %s\r\n",34," ����");
  455. SendClientMessage(playerid,0xFFFFFFFF,strtest);
  456. fwrite(f,strtest);
  457. fclose(f);
  458. return 1;
  459. }
  460. if(strcmp(cmd, "/setskin", true) == 0) {
  461. new tmp[256];
  462. tmp = strtok(cmdtext,idx);
  463. SetPlayerSkin(playerid,strval(tmp));
  464. return 1;
  465. }
  466. if(strcmp(cmd, "/setvars", true) == 0) {
  467. SetPVarInt(playerid,"num_test",7001);
  468. SetPVarString(playerid,"additional_tag","Hello World");
  469. SetPVarFloat(playerid,"some_float",1001.0);
  470. SendClientMessage(playerid,0xFFFFFFFF, "Vars set");
  471. return 1;
  472. }
  473. if(strcmp(cmd, "/modvars", true) == 0) {
  474. SetPVarInt(playerid,"num_test",8001);
  475. SetPVarString(playerid,"additional_tag","World Hello");
  476. SetPVarFloat(playerid,"some_float",6901.0);
  477. SendClientMessage(playerid,0xFFFFFFFF, "Vars modded");
  478. return 1;
  479. }
  480. if(strcmp(cmd, "/getvars", true) == 0) {
  481. new tst_IntRet;
  482. new Float:tst_FloatRet;
  483. new tst_StrRet[256];
  484. new tst_DispStr[256];
  485. tst_IntRet = GetPVarInt(playerid,"num_test");
  486. tst_FloatRet = GetPVarFloat(playerid,"some_float");
  487. GetPVarString(playerid,"additional_tag",tst_StrRet,256);
  488. format(tst_DispStr,256,"num_test: %d some_float: %f additional_tag: %s",tst_IntRet,tst_FloatRet,tst_StrRet);
  489. SendClientMessage(playerid,0xFFFFFFFF, tst_DispStr);
  490. return 1;
  491. }
  492. if(strcmp(cmd, "/delvars", true) == 0) {
  493. DeletePVar(playerid,"num_test");
  494. DeletePVar(playerid,"additional_tag");
  495. DeletePVar(playerid,"some_float");
  496. SendClientMessage(playerid,0xFFFFFFFF, "Vars deleted");
  497. return 1;
  498. }
  499. if(strcmp(cmd, "/pvarlist", true) == 0) {
  500. SendPVarListToPlayer(playerid);
  501. return 1;
  502. }
  503. if(strcmp(cmd, "/kill",true) == 0) {
  504. SetPlayerHealth(playerid,0.0);
  505. return 1;
  506. }
  507. if(strcmp(cmd, "/kickallnpc",true) == 0) {
  508. new p=0;
  509. while(p!=MAX_PLAYERS) {
  510. if(IsPlayerConnected(p) && IsPlayerNPC(p)) Kick(p);
  511. p++;
  512. }
  513. return 1;
  514. }
  515. if(strcmp(cmd, "/startengine",true) == 0) {
  516. new vid = GetPlayerVehicleID(playerid);
  517. if(vid != INVALID_VEHICLE_ID) {
  518. GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
  519. SetVehicleParamsEx(vid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
  520. }
  521. return 1;
  522. }
  523. if(strcmp(cmd, "/stopengine",true) == 0) {
  524. new vid = GetPlayerVehicleID(playerid);
  525. if(vid != INVALID_VEHICLE_ID) {
  526. GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
  527. SetVehicleParamsEx(vid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
  528. }
  529. return 1;
  530. }
  531. if(strcmp(cmd, "/openboot",true) == 0) {
  532. new vid = GetPlayerVehicleID(playerid);
  533. if(vid != INVALID_VEHICLE_ID) {
  534. GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
  535. SetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,VEHICLE_PARAMS_ON,objective);
  536. }
  537. return 1;
  538. }
  539. if(strcmp(cmd, "/closeboot",true) == 0) {
  540. new vid = GetPlayerVehicleID(playerid);
  541. if(vid != INVALID_VEHICLE_ID) {
  542. GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
  543. SetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,VEHICLE_PARAMS_OFF,objective);
  544. }
  545. return 1;
  546. }
  547. if(strcmp(cmd, "/openbonnet",true) == 0) {
  548. new vid = GetPlayerVehicleID(playerid);
  549. if(vid != INVALID_VEHICLE_ID) {
  550. GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
  551. SetVehicleParamsEx(vid,engine,lights,alarm,doors,VEHICLE_PARAMS_ON,boot,objective);
  552. }
  553. return 1;
  554. }
  555. if(strcmp(cmd, "/closebonnet",true) == 0) {
  556. new vid = GetPlayerVehicleID(playerid);
  557. if(vid != INVALID_VEHICLE_ID) {
  558. GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
  559. SetVehicleParamsEx(vid,engine,lights,alarm,doors,VEHICLE_PARAMS_OFF,boot,objective);
  560. }
  561. return 1;
  562. }
  563. if(strcmp(cmd, "/alarmon",true) == 0) {
  564. new vid = GetPlayerVehicleID(playerid);
  565. if(vid != INVALID_VEHICLE_ID) {
  566. GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
  567. SetVehicleParamsEx(vid,engine,lights,VEHICLE_PARAMS_ON,doors,bonnet,boot,objective);
  568. }
  569. return 1;
  570. }
  571. if(strcmp(cmd, "/alarmoff",true) == 0) {
  572. new vid = GetPlayerVehicleID(playerid);
  573. if(vid != INVALID_VEHICLE_ID) {
  574. GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
  575. SetVehicleParamsEx(vid,engine,lights,VEHICLE_PARAMS_OFF,doors,bonnet,boot,objective);
  576. }
  577. return 1;
  578. }
  579. if(strcmp(cmd, "/lightson",true) == 0) {
  580. new vid = GetPlayerVehicleID(playerid);
  581. if(vid != INVALID_VEHICLE_ID) {
  582. GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
  583. SetVehicleParamsEx(vid,engine,VEHICLE_PARAMS_ON,alarm,doors,bonnet,boot,objective);
  584. }
  585. return 1;
  586. }
  587. if(strcmp(cmd, "/lightsoff",true) == 0) {
  588. new vid = GetPlayerVehicleID(playerid);
  589. if(vid != INVALID_VEHICLE_ID) {
  590. GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
  591. SetVehicleParamsEx(vid,engine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);
  592. }
  593. return 1;
  594. }
  595. if(strcmp(cmd, "/holdobjectid",true) == 0) {
  596. new tmp[256];
  597. tmp = strtok(cmdtext,idx);
  598. SetPlayerAttachedObject(playerid,0,strval(tmp),6);
  599. SetPlayerAttachedObject(playerid,1,strval(tmp),5);
  600. //SetPlayerAttachedObject(playerid, 0, 1254,2, 0.1,0.05,0,0,90,0);
  601. return 1;
  602. }
  603. if(strcmp(cmd, "/removeheld",true) == 0) {
  604. new zz=0;
  605. while(zz!=MAX_PLAYER_ATTACHED_OBJECTS) {
  606. if(IsPlayerAttachedObjectSlotUsed(playerid, zz)) {
  607. RemovePlayerAttachedObject(playerid, zz);
  608. }
  609. zz++;
  610. }
  611. return 1;
  612. }
  613. if(strcmp(cmd, "/attachobj",true) == 0) {
  614. new tmp[256];
  615. tmp = strtok(cmdtext,idx);
  616. new obj = CreateObject(strval(tmp),0.0,0.0,0.0,0.0,0.0,0.0,200.0);
  617. AttachObjectToVehicle(obj,GetPlayerVehicleID(playerid),0.0,0.0,1.0,0.0,0.0,0.0);
  618. return 1;
  619. }
  620. if(strcmp(cmd, "/attachtome",true) == 0) {
  621. new tmp[256];
  622. tmp = strtok(cmdtext,idx);
  623. new obj = CreateObject(strval(tmp),0.0,0.0,0.0,0.0,0.0,0.0,200.0);
  624. AttachObjectToPlayer(obj,playerid,0.0,0.0,2.0,0.0,0.0,0.0);
  625. return 1;
  626. }
  627. if(strcmp(cmd, "/mapicontest",true) == 0) {
  628. new Float:X, Float:Y, Float:Z;
  629. GetPlayerPos(playerid, X, Y, Z);
  630. SetPlayerCheckpoint(playerid,X,Y,Z,5.0);
  631. SetPlayerMapIcon(playerid, 1, X+50.0, Y, Z, 52, 0, MAPICON_LOCAL_CHECKPOINT);
  632. SetPlayerMapIcon(playerid, 2, X+100.0, Y, Z, 53, 0, MAPICON_LOCAL_CHECKPOINT);
  633. SetPlayerMapIcon(playerid, 3, X+150.0, Y, Z, 54, 0, MAPICON_LOCAL_CHECKPOINT);
  634. SetPlayerMapIcon(playerid, 4, X+200.0, Y, Z, 55, 0, MAPICON_LOCAL_CHECKPOINT);
  635. SetPlayerMapIcon(playerid, 5, X+250.0, Y, Z, 0, 0x00FF00FF);
  636. return 1;
  637. }
  638. if(strcmp(cmd, "/mapicondel",true) == 0) {
  639. RemovePlayerMapIcon(playerid, 1);
  640. RemovePlayerMapIcon(playerid, 2);
  641. RemovePlayerMapIcon(playerid, 3);
  642. RemovePlayerMapIcon(playerid, 4);
  643. RemovePlayerMapIcon(playerid, 5);
  644. return 1;
  645. }
  646. if(strcmp(cmd, "/mapicontest2",true) == 0) {
  647. new Float:X, Float:Y, Float:Z;
  648. GetPlayerPos(playerid, X, Y, Z);
  649. RemovePlayerMapIcon(playerid, 0);
  650. SetPlayerMapIcon(playerid, 0, X, Y, Z, 33, 0, MAPICON_GLOBAL);
  651. RemovePlayerMapIcon(playerid, 2);
  652. SetPlayerMapIcon(playerid, 2, X+100.0, Y, Z, 55, 0, MAPICON_LOCAL);
  653. return 1;
  654. }
  655. if(strcmp(cmd, "/setweap",true) == 0) {
  656. new tmp[256];
  657. tmp = strtok(cmdtext,idx);
  658. SetPlayerArmedWeapon(playerid,strval(tmp));
  659. return 1;
  660. }
  661. if(strcmp(cmd, "/jetpack",true) == 0) {
  662. SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USEJETPACK);
  663. return 1;
  664. }
  665. if(strcmp(cmd, "/crobj",true) == 0) {
  666. new Float:X, Float:Y, Float:Z;
  667. new tmp[256];
  668. GetPlayerPos(playerid, X, Y, Z);
  669. tmp = strtok(cmdtext,idx);
  670. CreateObject(strval(tmp),X+1.0,Y+1.0,Z+0.5,0.0,0.0,0.0,200.0);
  671. return 1;
  672. }
  673. if(strcmp(cmd, "/dropaudio",true) == 0) {
  674. new Float:X, Float:Y, Float:Z;
  675. GetPlayerPos(playerid, X, Y, Z);
  676. PlayAudioStreamForPlayer(playerid, "http://somafm.com/tags.pls", X, Y, Z, 40.0, true);
  677. return 1;
  678. }
  679. if(strcmp(cmd, "/officefloor",true) == 0) {
  680. SetPlayerPos(playerid,1786.0645,-1298.7510,104.2);
  681. return 1;
  682. }
  683. if(strcmp(cmd, "/lvpd",true) == 0) {
  684. SetPlayerInterior(playerid, 3);
  685. SetPlayerPos(playerid,237.5571,148.7559,1005.4703);
  686. return 1;
  687. }
  688. if(strcmp(cmd, "/kill",true) == 0) {
  689. SetPlayerHealth(playerid,0.0);
  690. return 1;
  691. }
  692. if(strcmp(cmd, "/atrailer",true) == 0) {
  693. new tmp[256];
  694. tmp = strtok(cmdtext,idx);
  695. AttachTrailerToVehicle(strval(tmp),GetPlayerVehicleID(playerid));
  696. return 1;
  697. }
  698. if(strcmp(cmd, "/dtrailer",true) == 0) {
  699. if(GetVehicleTrailer(GetPlayerVehicleID(playerid)) != 0) {
  700. DetachTrailerFromVehicle(GetPlayerVehicleID(playerid));
  701. }
  702. return 1;
  703. }
  704. if(strcmp(cmd, "/cfence",true) == 0) {
  705. SetPlayerPos(playerid,2496.40, -1664.84, 13.19);
  706. if(!fence) fence = CreateObject(1410, 2496.80, -1661.88, 13.4, 0.00, 0.00, 0.00);
  707. return 1;
  708. }
  709. if(strcmp(cmd, "/mfence1",true) == 0) {
  710. MoveObject(fence, 2494.56, -1664.12, 13.4, 1.0, 0.00, 0.00, -90.0);
  711. return 1;
  712. }
  713. if(strcmp(cmd, "/mfence2",true) == 0) {
  714. MoveObject(fence, 2496.80, -1661.88, 13.4, 1.0, 0.00, 0.00, 0.00);
  715. return 1;
  716. }
  717. if(strcmp(cmd, "/usecell",true) == 0) {
  718. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USECELLPHONE);
  719. //SetPlayerAttachedObject(playerid, 4, 330, 6); // 4 = attachment slot, 330 = cellphone model, 6 = right hand
  720. return 1;
  721. }
  722. if(strcmp(cmd, "/stopcell",true) == 0) {
  723. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
  724. RemovePlayerAttachedObject(playerid, 4);
  725. return 1;
  726. }
  727. if(strcmp(cmd, "/objvehst",true) == 0) {
  728. new objveh;
  729. new objatt;
  730. new Float:X, Float:Y, Float:Z;
  731. GetPlayerPos(playerid, X, Y, Z);
  732. objveh = CreateVehicle(563, X+2.0, Y+2.0, Z, 0.0, 0, 0, -1);
  733. objatt = CreateObject(19277, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 200.0);
  734. AttachObjectToVehicle(objatt, objveh, 2.0, 0.15, 0.0, 0.0, 0.0, 90.0);
  735. return 1;
  736. }
  737. if(strcmp(cmd, "/uncontrol", true) == 0) {
  738. TogglePlayerControllable(playerid, 0);
  739. unfreezeplayer = playerid;
  740. //SetTimer("UnFreezeMe",5000,0);
  741. return 1;
  742. }
  743. if(strcmp(cmd, "/recontrol", true) == 0) {
  744. TogglePlayerControllable(playerid, 1);
  745. return 1;
  746. }
  747. if(strcmp(cmd, "/objlim1", true) == 0) {
  748. new Float:X, Float:Y, Float:Z;
  749. new lp=0;
  750. GetPlayerPos(playerid, X, Y, Z);
  751. while(lp != 999) {
  752. CreateObject(1656, X, Y, Z, 0.00, 0.00, 0.00, 1000.0);
  753. Y += 0.25;
  754. lp++;
  755. }
  756. return 1;
  757. }
  758. if(strcmp(cmd, "/kkeys", true) == 0) {
  759. new message[256+1];
  760. format(message, 256, "{FFFFFF}Left Key: {FFFF00}~k~~GO_LEFT~ {FFFFFF}Right Key: {FFFF00}~k~~GO_RIGHT~ {FFFFFF}Fire Key: {FFFF00}~k~~PED_FIREWEAPON~");
  761. SendClientMessage(playerid, 0xFFFFFFFF, message);
  762. return 1;
  763. }
  764. if(strcmp(cmd, "/timeddlg", true) == 0) {
  765. testlbplayer = playerid;
  766. SetTimer("ShowTestDialog",5000,0);
  767. return 1;
  768. }
  769. if(strcmp(cmd, "/editattach",true) == 0) {
  770. if(!IsPlayerAttachedObjectSlotUsed(playerid, 0)) {
  771. SetPlayerAttachedObject(playerid,0,19006,2); // red sunglasses to head bone
  772. }
  773. SendClientMessage(playerid, 0xFFFFFFFF, "Hint: Use {FFFF00}~k~~PED_SPRINT~{FFFFFF} to look around.");
  774. EditAttachedObject(playerid, 0);
  775. return 1;
  776. }
  777. if(strcmp(cmd, "/editobject",true) == 0) {
  778. if(edit_objectid == INVALID_OBJECT_ID) {
  779. new Float:X, Float:Y, Float:Z;
  780. GetPlayerPos(playerid, X, Y, Z);
  781. edit_objectid = CreateObject(1656,X+1.0,Y+1.0,Z+0.5,0.0,0.0,0.0,200.0);
  782. }
  783. SendClientMessage(playerid, 0xFFFFFFFF, "Hint: Use {FFFF00}~k~~PED_SPRINT~{FFFFFF} to look around.");
  784. EditObject(playerid, edit_objectid);
  785. return 1;
  786. }
  787. if(strcmp(cmd, "/selobj",true) == 0) {
  788. SendClientMessage(playerid, 0xFFFFFFFF, "Hint: Use {FFFF00}~k~~PED_SPRINT~{FFFFFF} to look around.");
  789. SelectObject(playerid);
  790. return 1;
  791. }
  792. if(strcmp(cmd, "/canceledit",true) == 0) {
  793. CancelEdit(playerid);
  794. return 1;
  795. }
  796. if(strcmp(cmd, "/editpobject",true) == 0) {
  797. if(edit_objectid == INVALID_OBJECT_ID) {
  798. new Float:X, Float:Y, Float:Z;
  799. GetPlayerPos(playerid, X, Y, Z);
  800. edit_objectid = CreatePlayerObject(playerid,19522,X+1.0,Y+1.0,Z+0.5,0.0,0.0,0.0,200.0);
  801. }
  802. SendClientMessage(playerid, 0xFFFFFFFF, "Hint: Use {FFFF00}~k~~PED_SPRINT~{FFFFFF} to look around.");
  803. EditPlayerObject(playerid, edit_objectid);
  804. return 1;
  805. }
  806. if(strcmp(cmd, "/cam_on_obj",true) == 0) {
  807. new Float:X, Float:Y, Float:Z;
  808. GetPlayerPos(playerid, X, Y, Z);
  809. if(edit_objectid == INVALID_OBJECT_ID) {
  810. edit_objectid = CreateObject(19320,X+1.0,Y+1.0,Z+0.5,0.0,0.0,0.0,200.0);
  811. }
  812. //TogglePlayerSpectating(playerid, 1);
  813. AttachCameraToObject(playerid, edit_objectid);
  814. MoveObject(edit_objectid, X, Y + 2000.0, Z + 400.0, 20.0);
  815. return 1;
  816. }
  817. if(strcmp(cmd, "/cam_on_train",true) == 0) {
  818. new Float:X, Float:Y, Float:Z;
  819. GetPlayerPos(playerid, X, Y, Z);
  820. if(edit_objectid == INVALID_OBJECT_ID) {
  821. edit_objectid = CreateObject(19320,X+1.0,Y+1.0,Z+0.5,0.0,0.0,0.0,200.0);
  822. }
  823. TogglePlayerSpectating(playerid, 1);
  824. AttachObjectToVehicle(edit_objectid, 9, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0);
  825. PlayerSpectateVehicle(playerid, 9);
  826. AttachCameraToObject(playerid, edit_objectid);
  827. return 1;
  828. }
  829. if(strcmp(cmd, "/cam_interp",true) == 0) {
  830. new Float:X, Float:Y, Float:Z;
  831. GetPlayerPos(playerid, X, Y, Z);
  832. InterpolateCameraPos(playerid, X, Y, Z, X + 100.0, Y + 100.0, Z + 20.0, 10000);
  833. return 1;
  834. }
  835. if(strcmp(cmd, "/cam_interp_look",true) == 0) {
  836. new Float:X, Float:Y, Float:Z;
  837. GetPlayerPos(playerid, X, Y, Z);
  838. InterpolateCameraPos(playerid, X, Y, Z, X + 100.0, Y + 100.0, Z + 20.0, 10000);
  839. InterpolateCameraLookAt(playerid, X, Y, Z, 0.0, 0.0, 0.0, 10000);
  840. return 1;
  841. }
  842. if(strcmp(cmd, "/cam_behind",true) == 0) {
  843. SetCameraBehindPlayer(playerid);
  844. return 1;
  845. }
  846. if(strcmp(cmd, "/respawn_veh",true) == 0) {
  847. new tmp[256];
  848. tmp = strtok(cmdtext,idx);
  849. SetVehicleToRespawn(strval(tmp));
  850. return 1;
  851. }
  852. if(strcmp(cmd, "/crplain", true) == 0) {
  853. CreateObject(19003, 416.54, 1655.75, 700.00, 0.00, 0.00, 0.00, 200.0);
  854. CreateObject(4561, -26.98, 1639.33, 98.03, 0.00, 0.00, 0.00, 1000.0);
  855. return 1;
  856. }
  857. if(strcmp(cmd, "/testplain", true) == 0) {
  858. CreateObject(19003, 416.54, 1655.75, 700.00, 0.00, 0.00, 0.00);
  859. if(GetPlayerVehicleID(playerid)) {
  860. SetVehiclePos(GetPlayerVehicleID(playerid), 416.54, 1655.75, 705.00);
  861. }
  862. else {
  863. SetPlayerPos(playerid, 416.54, 1655.75, 710.00);
  864. }
  865. return 1;
  866. }
  867. if(strcmp(cmd, "/testplain2", true) == 0) {
  868. CreateObject(10766, 168.86, 1686.77, 44.86, 0.00, 0.00, 0.00, 1000.0);
  869. CreateObject(10766, 168.86, 1532.52, 44.86, 0.00, 0.00, 0.00, 1000.0);
  870. if(GetPlayerVehicleID(playerid)) {
  871. SetVehiclePos(GetPlayerVehicleID(playerid), 162.9956, 1606.2555, 55.3197);
  872. }
  873. else {
  874. SetPlayerPos(playerid, 162.9956, 1606.2555, 55.3197);
  875. }
  876. return 1;
  877. }
  878. if(strcmp(cmd, "/clicktd",true) == 0) {
  879. new Text:txtTestText1;
  880. txtTestText1 = TextDrawCreate(320.0, 100.0, "Test Text 1");
  881. TextDrawUseBox(txtTestText1, 1);
  882. TextDrawBoxColor(txtTestText1, 0x00000044);
  883. TextDrawFont(txtTestText1, 3);
  884. TextDrawSetShadow(txtTestText1,0); // no shadow
  885. TextDrawSetOutline(txtTestText1,2); // thickness 1
  886. TextDrawBackgroundColor(txtTestText1,0x000000FF);
  887. TextDrawColor(txtTestText1,0xFFFFFFFF);
  888. TextDrawAlignment(txtTestText1,2); // centered
  889. TextDrawLetterSize(txtTestText1,0.5,1.5);
  890. TextDrawTextSize(txtTestText1, 20.0, 200.0); // reverse width and height for rockstar (only for centered td's)
  891. TextDrawSetSelectable(txtTestText1, 1);
  892. TextDrawShowForPlayer(playerid,txtTestText1);
  893. new Text:txtSprite1;
  894. txtSprite1 = TextDrawCreate(200.0, 220.0, "samaps:map"); // Text is txdfile:texture
  895. TextDrawFont(txtSprite1, 4); // Font ID 4 is the sprite draw font
  896. TextDrawColor(txtSprite1,0xFFFFFFFF);
  897. TextDrawTextSize(txtSprite1,200.0,200.0); // Text size is the Width:Height
  898. TextDrawSetSelectable(txtSprite1, 1);
  899. TextDrawShowForPlayer(playerid,txtSprite1);
  900. SelectTextDraw(playerid, 0x9999BBBB);
  901. return 1;
  902. }
  903. if(strcmp(cmd, "/playertd",true) == 0) {
  904. /*
  905. new PlayerText:PlayerTestText1;
  906. PlayerTestText1 = CreatePlayerTextDraw(playerid, 320.0, 100.0, "Test Text 1");
  907. PlayerTextDrawUseBox(playerid,PlayerTestText1, 1);
  908. PlayerTextDrawBoxColor(playerid,PlayerTestText1, 0x00000044);
  909. PlayerTextDrawFont(playerid,PlayerTestText1, 3);
  910. PlayerTextDrawSetShadow(playerid,PlayerTestText1,0); // no shadow
  911. PlayerTextDrawSetOutline(playerid,PlayerTestText1,2); // thickness 1
  912. PlayerTextDrawBackgroundColor(playerid, PlayerTestText1,0x000000FF);
  913. PlayerTextDrawColor(playerid,PlayerTestText1,0xFFFFFFFF);
  914. //PlayerTextDrawAlignment(playerid,PlayerTestText1,2); // centered
  915. PlayerTextDrawLetterSize(playerid,PlayerTestText1,0.5,1.5);
  916. PlayerTextDrawTextSize(playerid,PlayerTestText1, 50.0, 200.0); // reverse width and height for rockstar (only for centered td's)
  917. PlayerTextDrawSetSelectable(playerid,PlayerTestText1,1);
  918. PlayerTextDrawShow(playerid,PlayerTestText1);*/
  919. //SelectTextDraw(playerid, 0x9999BBBB);
  920. return 1;
  921. }
  922. if(strcmp(cmd, "/canceltd",true) == 0) {
  923. CancelSelectTextDraw(playerid);
  924. return 1;
  925. }
  926. if(strcmp(cmd, "/timed_vd", true) == 0) {
  927. vehicleid_tokill = GetPlayerVehicleID(playerid);
  928. SetTimer("TimedVehicleDeath",3000,0);
  929. return 1;
  930. }
  931. if(strcmp(cmd, "/vmodelsize", true) == 0) {
  932. new Float:X, Float:Y, Float:Z;
  933. new VehicleId = GetPlayerVehicleID(playerid);
  934. new message[256+1];
  935. if(!VehicleId || VehicleId == INVALID_VEHICLE_ID) {
  936. SendClientMessage(playerid, 0xFFFFFFFF, "/vmodelsize : Be in a vehicle to use this command." );
  937. return 1;
  938. }
  939. new VehicleModel = GetVehicleModel(VehicleId);
  940. GetVehicleModelInfo(VehicleModel, VEHICLE_MODEL_INFO_SIZE, X, Y, Z);
  941. format(message, 256, "Vehicle(%d) Size: %.4f, %.4f, %.4f", VehicleModel, X, Y, Z);
  942. SendClientMessage(playerid, 0xFFFFFFFF, message);
  943. return 1;
  944. }
  945. if(strcmp(cmd, "/crptex",true) == 0) {
  946. new lp=0;
  947. new Float:X, Float:Y, Float:Z;
  948. GetPlayerPos(playerid, X, Y, Z);
  949. X+=1.0;
  950. while(lp != 128) {
  951. test_tex_objects[lp] = CreatePlayerObject(playerid,19372,X,Y,Z+0.5,0.0,0.0,0.0,0.0);
  952. //SetPlayerObjectMaterial(playerid, test_tex_objects[lp], 0, 0, "null", "null", 0);
  953. if(lp % 2 == 0) {
  954. SetPlayerObjectMaterial(playerid, test_tex_objects[lp], 0, 19325, "all_walls", "stormdrain3_nt", 0xFF00FF00);
  955. } else {
  956. SetPlayerObjectMaterial(playerid, test_tex_objects[lp], 0, 19371, "all_walls", "stormdrain3_nt", 0xFF551155);
  957. }
  958. X+=2.0;
  959. lp++;
  960. }
  961. }
  962. if(strcmp(cmd, "/crpmix",true) == 0) {
  963. new lp=0;
  964. new Float:X, Float:Y, Float:Z;
  965. GetPlayerPos(playerid, X, Y, Z);
  966. X+=1.0;
  967. new szId[256+1];
  968. while(lp != 128) {
  969. test_tex_objects[lp] = CreatePlayerObject(playerid,19371,X,Y,Z+0.5,0.0,0.0,0.0,300.0);
  970. //format(szId, 256, "Text Here: {00FF00}%d", lp);
  971. //SetPlayerObjectMaterialText(playerid, test_tex_objects[lp], szId, 0, OBJECT_MATERIAL_SIZE_512x512, "Verdana", 60, 1, 0xFF5555FF, 0xFF000000, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
  972. if(lp % 2 == 0) {
  973. SetPlayerObjectMaterial(playerid, test_tex_objects[lp], 0, 19371, "all_walls", "stormdrain3_nt", 0xFF55AA55);
  974. } else {
  975. format(szId, 256, "Text: {00FF00}%d", lp);
  976. SetPlayerObjectMaterialText(playerid, test_tex_objects[lp], szId, 0, OBJECT_MATERIAL_SIZE_512x256, "Verdana", 60, 1, 0xFF5555FF, 0xFF000000, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
  977. }
  978. X+=2.0;
  979. lp++;
  980. }
  981. return 1;
  982. }
  983. if(strcmp(cmd, "/crptext",true) == 0) {
  984. new Float:X, Float:Y, Float:Z;
  985. GetPlayerPos(playerid, X, Y, Z);
  986. X+=1.0;
  987. test_tex_objects[0] = CreatePlayerObject(playerid,19479,X,Y,Z+0.5,0.0,0.0,0.0,300.0);
  988. SetObjectMaterialText(test_tex_objects[0], "Dynamic Update (0)", 0, OBJECT_MATERIAL_SIZE_512x128, "Courier New", 48, 1, 0xFF000000, 0, 0);
  989. X+=3.0;
  990. // This is a dynamic update material text
  991. if(text_update_timer == -1) {
  992. text_update_timer = SetTimer("UpdateTextTimer", 1000, 1);
  993. text_update_player = playerid;
  994. }
  995. test_tex_objects[1] = CreatePlayerObject(playerid,19479,X,Y,Z+4.0,0.0,0.0,0.0,300.0);
  996. SetPlayerObjectMaterialText(playerid, test_tex_objects[1], "ABDSJFUEGI\nABDRJCFEGI\n{DDDDDD}Center", 0, OBJECT_MATERIAL_SIZE_512x256, "GTAWEAPON3", 70, 0, 0xFF00FF00, 0xFF444477, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
  997. X+=3.0;
  998. test_tex_objects[2] = CreatePlayerObject(playerid,19480,X,Y,Z+4.0,0.0,0.0,0.0,300.0);
  999. SetPlayerObjectMaterialText(playerid, test_tex_objects[2], "Blue Text\nVerdana\nAlpha BG\n{DDDDDD}Center", 0, OBJECT_MATERIAL_SIZE_512x256, "Verdana", 60, 1, 0xFF000000, 0xFFFFFFFF, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
  1000. X+=3.0;
  1001. test_tex_objects[3] = CreatePlayerObject(playerid,19481,X,Y,Z+4.0,0.0,0.0,0.0,300.0);
  1002. SetPlayerObjectMaterialText(playerid, test_tex_objects[3], "Blue Text\nArial\nAlpha BG\n{DDDDDD}Center", 0, OBJECT_MATERIAL_SIZE_512x256, "Arial", 60, 1, 0xFF000000, 0xFFCDD704, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
  1003. X+=3.0;
  1004. test_tex_objects[4] = CreatePlayerObject(playerid,19482,X,Y,Z+4.0,0.0,0.0,0.0,300.0);
  1005. SetPlayerObjectMaterialText(playerid, test_tex_objects[4], "Blue Text\nVerdana\nAlpha BG\n{DDDDDD}Center", 0, OBJECT_MATERIAL_SIZE_512x256, "Verdana", 60, 1, 0xFF000000, 0xFFCDD704, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
  1006. X+=3.0;
  1007. test_tex_objects[5] = CreatePlayerObject(playerid,19483,X,Y,Z+4.0,0.0,0.0,0.0,300.0);
  1008. SetPlayerObjectMaterialText(playerid, test_tex_objects[5], "Blue Text\nArial\nAlpha BG\n{DDDDDD}Center", 0, OBJECT_MATERIAL_SIZE_512x256, "Arial", 60, 1, 0xFF000000, 0, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
  1009. X+=3.0;
  1010. //EditPlayerObject(playerid, test_tex_objects[0]);
  1011. return 1;
  1012. }
  1013. if(strcmp(cmd, "/delptex",true) == 0) {
  1014. new lp=0;
  1015. while(lp != 128) {
  1016. if(IsValidPlayerObject(playerid, test_tex_objects[lp])) {
  1017. DestroyPlayerObject(playerid, test_tex_objects[lp]);
  1018. }
  1019. lp++;
  1020. }
  1021. if(text_update_timer >= 0) {
  1022. KillTimer(text_update_timer);
  1023. text_update_timer = -1;
  1024. }
  1025. return 1;
  1026. }
  1027. // Damian's bed that crashed because material object id and original object id were the same
  1028. if(strcmp(cmd, "/crashbed",true) == 0) {
  1029. new objbed1=0;
  1030. new objbed2=0;
  1031. new Float:X, Float:Y, Float:Z;
  1032. GetPlayerPos(playerid, X, Y, Z);
  1033. // 14446
  1034. //0:18028:cj_bar2:CJ_nastybar_D2:000000;
  1035. //2:18646:matcolours:blue:000fff;
  1036. objbed1 = CreatePlayerObject(playerid,14446,X,Y,Z+0.1,0.0,0.0,0.0,300.0);
  1037. SetPlayerObjectMaterial(playerid, objbed1, 0, 18028, "cj_bar2", "CJ_nastybar_D2", 0xFF000000);
  1038. SetPlayerObjectMaterial(playerid, objbed1, 2, 18646, "matcolours", "blue", 0xFF000fff);
  1039. // 14446
  1040. //0:0:none:none:000000;
  1041. //1:0:none:none:0000ff;
  1042. //2:14446:carter_block:zebra_skin:000000;
  1043. objbed2 = CreatePlayerObject(playerid,14446,X,Y+2.0,Z+0.1,0.0,0.0,0.0,300.0);
  1044. SetPlayerObjectMaterial(playerid, objbed2, 0, 0, "none", "none", 0xFF000000);
  1045. SetPlayerObjectMaterial(playerid, objbed2, 1, 0, "none", "none", 0xFF0000FF);
  1046. //SetPlayerObjectMaterial(playerid, objbed2, 2, 18646, "matcolours", "blue", 0xFFFFFFFF);
  1047. SetPlayerObjectMaterial(playerid, objbed2, 2, 14446, "carter_block", "mp_carter_wall", 0xFFFFFFFF);
  1048. return 1;
  1049. }
  1050. // Damian's house object that is crashing in 0.3x
  1051. if(strcmp(cmd, "/crash_hobj",true) == 0) {
  1052. new objcab=0;
  1053. new Float:X, Float:Y, Float:Z;
  1054. GetPlayerPos(playerid, X, Y, Z);
  1055. //2385
  1056. //;index_id:model_id:txd_name:txd_txt:txd_color(0 if no color);
  1057. //;0:2748:pizza_furn:CJ_WOOD6:0;
  1058. //;1:2748:pizza_furn:CJ_WOOD6:A78D84;
  1059. //;2:2748:pizza_furn:CJ_WOOD6:A78D84;
  1060. objcab = CreatePlayerObject(playerid,2385,X,Y,Z+0.1,0.0,0.0,0.0,0.0);
  1061. SetPlayerObjectMaterial(playerid, objcab, 0, 2748, "pizza_furn", "CJ_WOOD6", 0);
  1062. SetPlayerObjectMaterial(playerid, objcab, 1, 2748, "pizza_furn", "CJ_WOOD6", 0xFFA78D84);
  1063. SetPlayerObjectMaterial(playerid, objcab, 2, 2748, "pizza_furn", "CJ_WOOD6", 0xFFA78D84);
  1064. /*
  1065. SetPlayerObjectMaterial(playerid, objcab, 0, -1, "none", "none", 0xFF00AA00);
  1066. SetPlayerObjectMaterial(playerid, objcab, 1, -1, "none", "none", 0xFF00AA00);
  1067. SetPlayerObjectMaterial(playerid, objcab, 2, -1, "none", "none", 0xFF00AA00);*/
  1068. return 1;
  1069. }
  1070. if(strcmp(cmd, "/kickmessage", true) == 0) {
  1071. KickWithMessage(playerid, "Bye!");
  1072. return 1;
  1073. }
  1074. if(strcmp(cmd, "/animindex", true) == 0) {
  1075. new msg[256+1];
  1076. new animlib[64+1];
  1077. new animname[64+1];
  1078. new tmp[256+1];
  1079. tmp = strtok(cmdtext,idx);
  1080. GetAnimationName(strval(tmp), animlib, 64, animname, 64);
  1081. format(msg,sizeof(msg),"AnimIndex: %d is %s:%s", strval(tmp), animlib, animname);
  1082. SendClientMessage(playerid, 0xFFFFFFFF, msg);
  1083. return 1;
  1084. }
  1085. if(strcmp(cmd, "/weapdata", true) == 0) {
  1086. new msg[256+1];
  1087. new x=0;
  1088. new weaponret;
  1089. new ammoret;
  1090. while(x!=13) {
  1091. GetPlayerWeaponData(playerid, x, weaponret, ammoret);
  1092. format(msg,sizeof(msg),"WeapSlot(%d) %d:%d", x, weaponret, ammoret);
  1093. SendClientMessage(playerid, 0xFFFFFFFF, msg);
  1094. x++;
  1095. }
  1096. return 1;
  1097. }
  1098. if(strcmp(cmd, "/explosion", true) == 0) {
  1099. new tmp[256];
  1100. tmp = strtok(cmdtext,idx);
  1101. new Float:X, Float:Y, Float:Z;
  1102. GetPlayerPos(playerid, X, Y, Z);
  1103. CreateExplosionEx(X+10.0, Y+10.0, Z+10.0, 1, 2.0, strval(tmp));
  1104. return 1;
  1105. }
  1106. if(strcmp(cmd, "/flatbedcontainer",true) == 0) {
  1107. new create_flatbed = SpawnVehicle_InfrontOfPlayer(playerid, 578, -1, -1);
  1108. new obj = CreateObject(19321,0.0,0.0,0.0,0.0,0.0,0.0);
  1109. AttachObjectToVehicle(obj,create_flatbed,-0.0165,-2.0660,1.2442,0.0,0.0,0.0);
  1110. return 1;
  1111. }
  1112. if(strcmp(cmd, "/disablevcol",true) == 0) {
  1113. DisableRemoteVehicleCollisions(playerid, 1);
  1114. return 1;
  1115. }
  1116. if(strcmp(cmd, "/enablevcol",true) == 0) {
  1117. DisableRemoteVehicleCollisions(playerid, 0);
  1118. return 1;
  1119. }
  1120. if(strcmp(cmd, "/disablecamtarget",true) == 0) {
  1121. EnablePlayerCameraTarget(playerid, 0);
  1122. return 1;
  1123. }
  1124. if(strcmp(cmd, "/enablecamtarget",true) == 0) {
  1125. EnablePlayerCameraTarget(playerid, 1);
  1126. return 1;
  1127. }
  1128. if(strcmp(cmd, "/poolsize", true) == 0) {
  1129. new msg[256+1];
  1130. new HigestPlayerId = GetPlayerPoolSize();
  1131. new HigestVehicleId = GetVehiclePoolSize();
  1132. format(msg,sizeof(msg),"PlayerPoolSize: %d", HigestPlayerId);
  1133. SendClientMessage(playerid, 0xFFFFFFFF, msg);
  1134. format(msg,sizeof(msg),"VehiclePoolSize: %d", HigestVehicleId);
  1135. SendClientMessage(playerid, 0xFFFFFFFF, msg);
  1136. return 1;
  1137. }
  1138. if(strcmp(cmd, "/sirenstate", true ) == 0)
  1139. {
  1140. if( GetPlayerVehicleID(playerid) && GetPlayerVehicleID(playerid) != INVALID_VEHICLE_ID &&
  1141. GetVehicleParamsSirenState(GetPlayerVehicleID(playerid)) == VEHICLE_PARAMS_ON )
  1142. {
  1143. SendClientMessage(playerid, 0xFFFFFFFF, "Siren is ON");
  1144. }
  1145. else {
  1146. SendClientMessage(playerid, 0xFFFFFFFF, "Siren is OFF");
  1147. }
  1148. return 1;
  1149. }
  1150. if(strcmp(cmd, "/opencardoors", true ) == 0)
  1151. {
  1152. if(GetPlayerVehicleID(playerid) && GetPlayerVehicleID(playerid) != INVALID_VEHICLE_ID)
  1153. {
  1154. SetVehicleParamsCarDoors(GetPlayerVehicleID(playerid), VEHICLE_PARAMS_ON, VEHICLE_PARAMS_ON, VEHICLE_PARAMS_ON, VEHICLE_PARAMS_ON);
  1155. }
  1156. /*
  1157. if(GetPlayerCameraTargetVehicle(playerid) != INVALID_VEHICLE_ID)
  1158. {
  1159. SetVehicleParamsCarDoors(GetPlayerCameraTargetVehicle(playerid), VEHICLE_PARAMS_ON, VEHICLE_PARAMS_ON, VEHICLE_PARAMS_ON, VEHICLE_PARAMS_ON);
  1160. }*/
  1161. return 1;
  1162. }
  1163. if(strcmp(cmd, "/closecardoors", true ) == 0)
  1164. {
  1165. if(GetPlayerVehicleID(playerid) && GetPlayerVehicleID(playerid) != INVALID_VEHICLE_ID)
  1166. {
  1167. SetVehicleParamsCarDoors(GetPlayerVehicleID(playerid), VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF);
  1168. }
  1169. /*
  1170. if(GetPlayerCameraTargetVehicle(playerid) != INVALID_VEHICLE_ID)
  1171. {
  1172. SetVehicleParamsCarDoors(GetPlayerCameraTargetVehicle(playerid), VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF);
  1173. }*/
  1174. return 1;
  1175. }
  1176. if(strcmp(cmd, "/opencarwindows", true ) == 0)
  1177. {
  1178. if(GetPlayerVehicleID(playerid) && GetPlayerVehicleID(playerid) != INVALID_VEHICLE_ID)
  1179. {
  1180. SetVehicleParamsCarWindows(GetPlayerVehicleID(playerid), VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF);
  1181. }
  1182. return 1;
  1183. }
  1184. if(strcmp(cmd, "/closecarwindows", true ) == 0)
  1185. {
  1186. if(GetPlayerVehicleID(playerid) && GetPlayerVehicleID(playerid) != INVALID_VEHICLE_ID)
  1187. {
  1188. SetVehicleParamsCarWindows(GetPlayerVehicleID(playerid), VEHICLE_PARAMS_ON, VEHICLE_PARAMS_ON, VEHICLE_PARAMS_ON, VEHICLE_PARAMS_ON);
  1189. }
  1190. return 1;
  1191. }
  1192. if(strcmp(cmd, "/spritetest", true ) == 0)
  1193. {
  1194. txtSpriteTest[0] = TextDrawCreate(100.0, 100.0, "ld_grav:timer"); // Text is txdfile:texture
  1195. TextDrawFont(txtSpriteTest[0], 4); // Font ID 4 is the sprite draw font
  1196. TextDrawColor(txtSpriteTest[0],0xFFFFFFFF);
  1197. TextDrawTextSize(txtSpriteTest[0],100.0,100.0); // Text size is the Width:Height
  1198. TextDrawShowForPlayer(playerid,txtSpriteTest[0]);
  1199. txtSpriteTest[1] = TextDrawCreate(200.0, 100.0, "ld_grav:bee2"); // Text is txdfile:texture
  1200. TextDrawFont(txtSpriteTest[1], 4); // Font ID 4 is the sprite draw font
  1201. TextDrawColor(txtSpriteTest[1],0xFFFFFFFF);
  1202. TextDrawTextSize(txtSpriteTest[1],100.0,100.0); // Text size is the Width:Height
  1203. TextDrawShowForPlayer(playerid,txtSpriteTest[1]);
  1204. txtSpriteTest[2] = TextDrawCreate(100.0, 200.0, "ld_slot:r_69"); // Text is txdfile:texture
  1205. TextDrawFont(txtSpriteTest[2], 4); // Font ID 4 is the sprite draw font
  1206. TextDrawColor(txtSpriteTest[2],0xFFFFFFFF);
  1207. TextDrawTextSize(txtSpriteTest[2],100.0,100.0); // Text size is the Width:Height
  1208. TextDrawShowForPlayer(playerid,txtSpriteTest[2]);
  1209. txtSpriteTest[3] = TextDrawCreate(200.0, 200.0, "ld_slot:cherry"); // Text is txdfile:texture
  1210. TextDrawFont(txtSpriteTest[3], 4); // Font ID 4 is the sprite draw font
  1211. TextDrawColor(txtSpriteTest[3],0xFFFFFFFF);
  1212. TextDrawTextSize(txtSpriteTest[3],100.0,100.0); // Text size is the Width:Height
  1213. TextDrawShowForPlayer(playerid,txtSpriteTest[3]);
  1214. txtSpriteTest[4] = TextDrawCreate(100.0, 300.0, "ld_card:cd9d"); // Text is txdfile:texture
  1215. TextDrawFont(txtSpriteTest[4], 4); // Font ID 4 is the sprite draw font
  1216. TextDrawColor(txtSpriteTest[4],0xFFFFFFFF);
  1217. TextDrawTextSize(txtSpriteTest[4],100.0,100.0); // Text size is the Width:Height
  1218. TextDrawShowForPlayer(playerid,txtSpriteTest[4]);
  1219. return 1;
  1220. }
  1221. if(strcmp(cmd, "/delspritetest", true ) == 0)
  1222. {
  1223. TextDrawDestroy(txtSpriteTest[0]);
  1224. TextDrawDestroy(txtSpriteTest[1]);
  1225. TextDrawDestroy(txtSpriteTest[2]);
  1226. TextDrawDestroy(txtSpriteTest[3]);
  1227. TextDrawDestroy(txtSpriteTest[4]);
  1228. return 1;
  1229. }
  1230. if(strcmp(cmd, "/removeallbuilding", true ) == 0)
  1231. {
  1232. RemoveBuildingForPlayer(playerid, -1, 0.0, 0.0, 0.0, 6000.0);
  1233. return 1;
  1234. }
  1235. if(strcmp(cmd, "/actoratme", true ) == 0)
  1236. {
  1237. new Float:X, Float:Y, Float:Z, Float:fang;
  1238. GetPlayerPos(playerid, X, Y, Z);
  1239. GetPlayerFacingAngle(playerid, fang);
  1240. test_actor_id = CreateActor(305, X+1.0, Y+1.0, Z+0.5, fang);
  1241. //SetActorInvulnerable(test_actor_id);
  1242. SetActorVirtualWorld(test_actor_id, GetPlayerVirtualWorld(playerid));
  1243. return 1;
  1244. }
  1245. if(strcmp(cmd, "/actorground", true) == 0) {
  1246. ApplyActorAnimation(test_actor_id, "BEACH", "ParkSit_M_loop", 4.0, 1, 1, 1, 1, -1);
  1247. return 1;
  1248. }
  1249. if(strcmp(cmd, "/actorclear", true) == 0) {
  1250. ClearActorAnimations(test_actor_id);
  1251. return 1;
  1252. }
  1253. if(strcmp(cmd, "/actorface", true) == 0) {
  1254. new Float:fang;
  1255. GetPlayerFacingAngle(playerid, fang);
  1256. SetActorFacingAngle(test_actor_id, fang);
  1257. return 1;
  1258. }
  1259. if(strcmp(cmd, "/actorpos", true) == 0) {
  1260. new Float:X, Float:Y, Float:Z;
  1261. GetPlayerPos(playerid, X, Y, Z);
  1262. SetActorPos(test_actor_id, X+1.0, Y+1.0, Z);
  1263. return 1;
  1264. }
  1265. return 0;
  1266. }
  1267. //-------------------------------------------
  1268. forward KickPublic(playerid);
  1269. public KickPublic(playerid) { Kick(playerid); }
  1270. //-------------------------------------------
  1271. KickWithMessage(playerid, message[])
  1272. {
  1273. SendClientMessage(playerid, 0xFF4444FF, message);
  1274. SetTimerEx("KickPublic", 1000, 0, "d", playerid);
  1275. }
  1276. //-------------------------------------------
  1277. public OnPlayerClickTextDraw(playerid, Text:clickedid)
  1278. {
  1279. new msg[256+1];
  1280. format(msg,sizeof(msg),"(TextDraw) You selected: %d", int:clickedid);
  1281. SendClientMessage(playerid, 0xFFFFFFFF, msg);
  1282. }
  1283. //-------------------------------------------
  1284. public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
  1285. {
  1286. new msg[256+1];
  1287. format(msg,sizeof(msg),"(PlayerTextDraw) You selected: %d", int:playertextid);
  1288. SendClientMessage(playerid, 0xFFFFFFFF, msg);
  1289. }
  1290. //-------------------------------------------
  1291. // Sends a list of all PVars to the player as
  1292. // client messages.
  1293. SendPVarListToPlayer(playerid)
  1294. {
  1295. new ubound = GetPVarsUpperIndex(playerid);
  1296. new x=0;
  1297. new name[40+1];
  1298. new line[128+1];
  1299. SendClientMessage(playerid,0xF000F0F0, "---Player Vars List---");
  1300. while(x != ubound) {
  1301. if(GetPVarNameAtIndex(playerid,x,name,40)) {
  1302. if(Util_GetPVarEntryAsString(playerid,name,line,128)) {
  1303. SendClientMessage(playerid,0xFFFFFFFF,line);
  1304. }
  1305. }
  1306. x++;
  1307. }
  1308. }
  1309. //-------------------------------------------
  1310. // return PVar entry as 'name'='value' string
  1311. stock Util_GetPVarEntryAsString(playerid, name[], ret[], len)
  1312. {
  1313. new Float:fValue;
  1314. new iValue;
  1315. new szStrValue[1024+1]; // this might require greater size if you store large strings in PVars
  1316. new type;
  1317. ret[0] = EOS;
  1318. type = GetPVarType(playerid, name);
  1319. if(type != PLAYER_VARTYPE_NONE) {
  1320. switch(type)
  1321. {
  1322. case PLAYER_VARTYPE_STRING:
  1323. {
  1324. GetPVarString(playerid,name,szStrValue,1024);
  1325. format(ret,len,"%s=%s",name,szStrValue);
  1326. }
  1327. case PLAYER_VARTYPE_INT:
  1328. {
  1329. iValue = GetPVarInt(playerid,name);
  1330. format(ret,len,"%s=%d",name,iValue);
  1331. }
  1332. case PLAYER_VARTYPE_FLOAT:
  1333. {
  1334. fValue = GetPVarFloat(playerid,name);
  1335. format(ret,len,"%s=%f",name,fValue);
  1336. }
  1337. }
  1338. return 1;
  1339. }
  1340. return 0;
  1341. }
  1342. //-------------------------------------------
  1343. // Fills the provided string with all the player's PVars
  1344. // seperated by the specified 'delimiter'
  1345. stock Util_CreatePVarList(playerid, retstr[], len, delimiter[])
  1346. {
  1347. if(!IsPlayerConnected(playerid)) return 0;
  1348. new x=0;
  1349. new remaining_string=len;
  1350. new line[2048+1];
  1351. new name[40+1];
  1352. retstr[0] = EOS;
  1353. new ubound = GetPVarsUpperIndex(playerid);
  1354. while(x != ubound) {
  1355. if(GetPVarNameAtIndex(playerid,x,name,40)) {
  1356. if(Util_GetPVarEntryAsString(playerid,name,line,2048)) {
  1357. // if there is enough space, concat this line to the return string
  1358. if(remaining_string > (strlen(line) + strlen(delimiter))) {
  1359. strcat(retstr,line);
  1360. strcat(retstr,delimiter);
  1361. remaining_string -= (strlen(line) + strlen(delimiter));
  1362. }
  1363. }
  1364. }
  1365. x++;
  1366. }
  1367. return 1;
  1368. }
  1369. //-------------------------------------------
  1370. // Test reapplying vehicle mods on respawn
  1371. public OnVehicleSpawn(vehicleid)
  1372. {
  1373. if(vehicleid == savanna) {
  1374. AddVehicleComponent(savanna,1189); //Front Bumper
  1375. AddVehicleComponent(savanna,1187); //Rear Bumper
  1376. AddVehicleComponent(savanna,1129); //Exhaust
  1377. AddVehicleComponent(savanna,1102); //Left Side Skirt
  1378. AddVehicleComponent(savanna,1133); //Right Side Skirt
  1379. AddVehicleComponent(savanna,1078); //Wheels
  1380. AddVehicleComponent(savanna,1010); //Nitro 10x
  1381. AddVehicleComponent(savanna,1087); //Hydraulics
  1382. }
  1383. else if(vehicleid == blade) {
  1384. AddVehicleComponent(blade,1182); //Front Bumper
  1385. AddVehicleComponent(blade,1184); //Rear Bumper
  1386. AddVehicleComponent(blade,1104); //Exhaust
  1387. AddVehicleComponent(blade,1108); //Left Side Skirt
  1388. AddVehicleComponent(blade,1107); //Right Side Skirt
  1389. AddVehicleComponent(blade,1078); //Wheels
  1390. AddVehicleComponent(blade,1010); //Nitro 10x
  1391. AddVehicleComponent(blade,1087); //Hydraulics
  1392. }
  1393. }
  1394. //-------------------------------------------
  1395. // Example of handling dialog responses.
  1396. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  1397. {
  1398. if(!IsPlayerAdmin(playerid)) return 0; // this is an admin only script
  1399. if(dialogid == 0) { // Our example msgbox
  1400. if(response) {
  1401. SendClientMessage(playerid,0xFFFFFFFF,"You selected OK");
  1402. } else {
  1403. SendClientMessage(playerid,0xFFFFFFFF,"You selected Cancel");
  1404. }
  1405. return 1; // we processed this. no need for other filterscripts to process it.
  1406. }
  1407. if(dialogid == 1) { // Our example inputbox
  1408. if(response) {
  1409. new message[256+1];
  1410. format(message, 256, "You replied: %s", inputtext);
  1411. SendClientMessage(playerid, 0xFFFFFFFF, message);
  1412. } else {
  1413. SendClientMessage(playerid, 0xFFFFFFFF, "You selected Cancel");
  1414. }
  1415. return 1; // we processed it.
  1416. }
  1417. if(dialogid == 2) { // Our example listbox
  1418. if(response) {
  1419. new message[256+1];
  1420. format(message, 256, "You selected item %d:", listitem);
  1421. SendClientMessage(playerid, 0xFFFFFFFF, message);
  1422. SendClientMessage(playerid, 0xFFFFFFFF, inputtext);
  1423. } else {
  1424. SendClientMessage(playerid, 0xFFFFFFFF, "You selected Cancel");
  1425. }
  1426. return 1; // we processed it.
  1427. }
  1428. return 0; // we didn't handle anything.
  1429. }
  1430. //-------------------------------------------
  1431. // Example of handling scoreboard click.
  1432. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  1433. {
  1434. if(!IsPlayerAdmin(playerid)) return 0; // this is an admin only script
  1435. new message[256+1];
  1436. format(message, 256, "You clicked on player %d", clickedplayerid);
  1437. SendClientMessage(playerid, 0xFFFFFFFF, message);
  1438. return 1;
  1439. }
  1440. //-------------------------------------------
  1441. public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
  1442. {
  1443. new message[256+1];
  1444. format(message, 256, "You place marker at point: %f %f %f", fX, fY, fZ);
  1445. SendClientMessage(playerid, 0xFFFFFFFF, message);
  1446. SetPlayerPos(playerid, fX, fY, fZ);
  1447. }
  1448. //-------------------------------------------
  1449. /*
  1450. public OnPlayerEditAttachedObject( playerid, response, index, modelid, boneid,
  1451. Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ,
  1452. Float:fRotX, Float:fRotY, Float:fRotZ,
  1453. Float:fScaleX, Float:fScaleY, Float:fScaleZ )
  1454. {
  1455. SendClientMessage(playerid, 0xFFFFFFFF, "You finished editing an attached object");
  1456. SetPlayerAttachedObject(playerid,index,modelid,boneid,fOffsetX,fOffsetY,fOffsetZ,fRotX,fRotY,fRotZ,fScaleX,fScaleY,fScaleZ);
  1457. return 1;
  1458. }*/
  1459. //-------------------------------------------
  1460. public OnPlayerEditObject( playerid, playerobject, objectid, response,
  1461. Float:fX, Float:fY, Float:fZ, Float:fRotX, Float:fRotY, Float:fRotZ )
  1462. {
  1463. if(!playerobject) {
  1464. if(!IsValidObject(objectid)) return;
  1465. MoveObject(objectid, fX, fY, fZ, 10.0, fRotX, fRotY, fRotZ);
  1466. } else {
  1467. if(!IsValidPlayerObject(playerid, objectid)) return;
  1468. MovePlayerObject(playerid, objectid, fX, fY, fZ, 10.0, fRotX, fRotY, fRotZ);
  1469. }
  1470. if(response == EDIT_RESPONSE_FINAL || response == EDIT_RESPONSE_CANCEL) {
  1471. // put them back in selection mode after they click save
  1472. SelectObject(playerid);
  1473. }
  1474. }
  1475. //-------------------------------------------
  1476. public OnPlayerSelectObject(playerid, type, objectid, modelid, Float:fX, Float:fY, Float:fZ)
  1477. {
  1478. new message[256+1];
  1479. if(type == SELECT_OBJECT_GLOBAL_OBJECT) {
  1480. if(!IsValidObject(objectid)) return 0;
  1481. format(message,sizeof(message),"(Object) You selected: %d model: %d Pos: %.4f,%.4f,%.4f", objectid, modelid, fX, fY, fZ);
  1482. SendClientMessage(playerid, 0xFFFFFFFF, message);
  1483. EditObject(playerid, objectid);
  1484. return 1;
  1485. }
  1486. if(type == SELECT_OBJECT_PLAYER_OBJECT) {
  1487. if(!IsValidPlayerObject(playerid, objectid)) return 0;
  1488. format(message,sizeof(message),"(Player Object) You selected: %d model: %d Pos: %.4f,%.4f,%.4f", objectid, modelid, fX, fY, fZ);
  1489. SendClientMessage(playerid, 0xFFFFFFFF, message);
  1490. EditPlayerObject(playerid, objectid);
  1491. return 1;
  1492. }
  1493. return 0;
  1494. }
  1495. //-------------------------------------------
  1496. /*
  1497. public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
  1498. {
  1499. new message[256+1];
  1500. new weaponname[64+1];
  1501. new File:file = fopen("playershots.txt",io_append);
  1502. GetWeaponName(weaponid, weaponname, 64);
  1503. if(hittype == BULLET_HIT_TYPE_PLAYER) {
  1504. format(message,256,"Shooter(%d) hit Player(%d) PlayerAnim: %d Using: %s [%.2f, %.2f, %.2f]\r\n", playerid, hitid,
  1505. GetPlayerAnimationIndex(hitid), weaponname, fX, fY, fZ);
  1506. }
  1507. else if(hittype == BULLET_HIT_TYPE_VEHICLE) {
  1508. format(message,256,"Shooter(%d) hit Vehicle(%d) Using: %s [%.2f, %.2f, %.2f]\r\n",playerid, hitid, weaponname, fX, fY, fZ);
  1509. }
  1510. else if(hittype == BULLET_HIT_TYPE_NONE) {
  1511. format(message,256,"Shooter(%d) hit World Using: %s [%.2f, %.2f, %.2f]\r\n",playerid,weaponname,fX,fY,fZ);
  1512. }
  1513. else {
  1514. format(message,256,"Shooter(%d) hit Object(%d) Using: %s [%.2f, %.2f, %.2f]\r\n",playerid, hitid, weaponname, fX, fY, fZ);
  1515. }
  1516. fwrite(file, message);
  1517. fclose(file);
  1518. //new LastVectors[128+1];
  1519. //new Float:OriginX, Float:OriginY, Float:OriginZ;
  1520. //new Float:HitX, Float:HitY, Float:HitZ;
  1521. //GetPlayerLastShotVectors(playerid, OriginX, OriginY, OriginZ, HitX, HitY, HitZ);
  1522. //format(LastVectors, 128, "Last Vectors: [%.2f, %.2f, %.2f] [%.2f, %.2f, %.2f]", OriginX, OriginY, OriginZ, HitX, HitY, HitZ);
  1523. //SendClientMessage(playerid, 0xFFFFFFFF, LastVectors);
  1524. SendClientMessage(playerid, 0xFFFFFFFF, message);
  1525. return 1;
  1526. }*/
  1527. //-------------------------------------------
  1528. /*
  1529. new LastShotTime = 0;
  1530. new LastShotWeapon = 0;
  1531. public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
  1532. {
  1533. new message[128+1];
  1534. if(!LastShotTime) {
  1535. LastShotTime = GetTickCount();
  1536. return 1;
  1537. }
  1538. if(weaponid == LastShotWeapon) {
  1539. format(message, 128, "WeaponId: %d LastShotDelta: %d", weaponid, GetTickCount() - LastShotTime);
  1540. SendClientMessage(playerid, 0xFFFFFFFF, message);
  1541. printf("%s", message);
  1542. }
  1543. LastShotWeapon = weaponid;
  1544. LastShotTime = GetTickCount();
  1545. return 1;
  1546. }*/
  1547. //-------------------------------------------
  1548. // Example of TakeDamage
  1549. /*
  1550. public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
  1551. {
  1552. new File:file = fopen("playershots.txt",io_append);
  1553. new message[256+1];
  1554. new weapname[64+1];
  1555. if(issuerid != INVALID_PLAYER_ID) {
  1556. GetWeaponName(weaponid, weapname, 64);
  1557. format(message, 256, "PlayerTakeDamage(%d) from Player(%d) (%f) weapon: (%s) bodypart: %d\r\n", playerid, issuerid, amount, weapname, bodypart);
  1558. SendClientMessageToAll(0xFFFFFFFF, message);
  1559. }
  1560. else {
  1561. format(message, 256, "PlayerTakeDamage(%d) (%f) from: %d\r\n", playerid, amount, weaponid);
  1562. SendClientMessageToAll(0xFFFFFFFF, message);
  1563. }
  1564. fwrite(file, message);
  1565. fclose(file);
  1566. }*/
  1567. //-------------------------------------------
  1568. // Example of GiveDamage
  1569. /*
  1570. public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid, bodypart)
  1571. {
  1572. new File:file = fopen("playershots.txt",io_append);
  1573. new message[256+1];
  1574. new weapname[64+1];
  1575. GetWeaponName(weaponid, weapname, 64);
  1576. format(message, 256, "PlayerGiveDamage(%d) to Player(%d) (%f) weapon: (%s) bodypart: %d\r\n", playerid, damagedid, amount, weapname, bodypart);
  1577. fwrite(file, message);
  1578. fclose(file);
  1579. SendClientMessageToAll(0xFFFFFFFF, message);
  1580. }*/
  1581. //-------------------------------------------
  1582. /*
  1583. public OnPlayerGiveDamageActor(playerid, damaged_actorid, Float:amount, weaponid, bodypart)
  1584. {
  1585. new message[256+1];
  1586. new weapname[64+1];
  1587. GetWeaponName(weaponid, weapname, 64);
  1588. format(message, 256, "PlayerGiveDamageActor(%d) to Actor(%d) (%f) weapon: (%s) bodypart: %d\r\n", playerid, damaged_actorid, amount, weapname, bodypart);
  1589. SendClientMessageToAll(0xFFFFFFFF, message);
  1590. if(IsValidActor(damaged_actorid)) {
  1591. new Float:fActorHealth;
  1592. GetActorHealth(damaged_actorid, fActorHealth);
  1593. fActorHealth -= amount;
  1594. if(fActorHealth < 0.0) fActorHealth = 0.0;
  1595. SetActorHealth(damaged_actorid, fActorHealth);
  1596. }
  1597. }
  1598. */
  1599. //-------------------------------------------
  1600. /*
  1601. public OnPlayerDeath(playerid, killerid, reason)
  1602. {
  1603. SendDeathMessage(killerid, playerid, reason);
  1604. return 1;
  1605. }*/
  1606. //-------------------------------------------
  1607. /*
  1608. public OnEnterExitModShop(playerid, enterexit, interiorid)
  1609. {
  1610. new message[256+1];
  1611. if(enterexit) {
  1612. format(message, 256, "You entered modshop at interior %d", interiorid);
  1613. SendClientMessage(playerid, 0xFFFFFFFF, message);
  1614. } else {
  1615. format(message, 256, "You exited the modshop");
  1616. SendClientMessage(playerid, 0xFFFFFFFF, message);
  1617. }
  1618. return 1;
  1619. }
  1620. */
  1621. //-------------------------------------------
  1622. /*
  1623. public OnVehicleDamageStatusUpdate(vehicleid, playerid)
  1624. {
  1625. new panel, doors, lights, tires;
  1626. new update_msg[128+1];
  1627. if(!IsPlayerAdmin(playerid)) return 0;
  1628. GetVehicleDamageStatus(vehicleid,panel,doors,lights,tires);
  1629. format(update_msg,128,"VehicleDamage[ID:%d PN:0x%x DR:0x%x LT:0x%x TR:0x%x]",vehicleid,panel,doors,lights,tires);
  1630. SendClientMessage(playerid,0xFFFFFFFF,update_msg);
  1631. return 1;
  1632. }*/
  1633. //-------------------------------------------
  1634. /*
  1635. public OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, Float:new_x, Float:new_y, Float:new_z)
  1636. {
  1637. new update_msg[128+1];
  1638. new Float:X, Float:Y, Float:Z;
  1639. //if(!IsPlayerAdmin(playerid)) return 0;
  1640. GetVehiclePos(vehicleid, X, Y, Z);
  1641. format(update_msg,128,"NoDriverVehicleUpdate(playerid=%d vehicle=%d passenger=%d cur_pos: %.2f %.2f %.2f new_pos: %.2f %.2f %.2f)",
  1642. playerid, vehicleid, passenger_seat, X, Y, Z, new_x, new_y, new_z);
  1643. SendClientMessageToAll(0xFFFFFFFF,update_msg);
  1644. return 1;
  1645. }*/
  1646. //-------------------------------------------