Advertisement
Guest User

Untitled

a guest
May 11th, 2017
536
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 9.15 KB | None | 0 0
  1. // Rizard's Playerlist - I can't stop you from removing credits but if you are human then leave this line or add me to your credits list!!
  2. // GOOD LUCK WITH IT - any questions regarding this... reply in the FS topic or email: rizzy.duh@gmail.com
  3. // uncomment the line below if you want to write a filterscript
  4. #define FILTERSCRIPT
  5.  
  6. #include <a_samp>
  7.  
  8. #if defined FILTERSCRIPT
  9.  
  10. new SCORE_ADDED = 1;
  11. new PING_ADDED = 1;
  12. new ID_ADDED = 1;
  13.  
  14. forward ShowPlayerList(playerid);
  15.  
  16. public OnFilterScriptInit()
  17. {
  18.     print("\n--------------------------------------");
  19.     print(" Rizard's Playerlist ");
  20.     print("--------------------------------------\n");
  21.     return 1;
  22. }
  23.  
  24. // Rizard's Playerlist - I can't stop you from removing credits but if you are human then leave this line or add me to your credits list!!
  25. // GOOD LUCK WITH IT - any questions regarding this... reply in the FS topic or email: rizzy.duh@gmail.com
  26.  
  27.  
  28. stock PlayerName(playerid)
  29. {new name[MAX_PLAYER_NAME];GetPlayerName(playerid, name, sizeof(name));return name;}
  30.  
  31. public ShowPlayerList(playerid)
  32. {
  33.     if(SCORE_ADDED == 1 && PING_ADDED == 1 && ID_ADDED == 1)
  34.     {
  35.         new string[50],newstring[50];
  36.         for(new i=0;i<MAX_PLAYERS;i++)
  37.         {if(IsPlayerConnected(i)){format(newstring,sizeof(newstring),"%d         %d           %d       %s\n",i,GetPlayerScore(i),GetPlayerPing(i),PlayerName(i));strcat(string,newstring);}}
  38.         ShowPlayerDialog(playerid,1212,DIALOG_STYLE_LIST,"  id     score     ping     name",string,"select","cancel");
  39.     }
  40.     else if(SCORE_ADDED == 0 && PING_ADDED == 1 && ID_ADDED == 1)
  41.     {
  42.         new string[50],newstring[50];
  43.         for(new i=0;i<MAX_PLAYERS;i++){if(IsPlayerConnected(i)){format(newstring,sizeof(newstring),"%d       %d       %s\n",i,GetPlayerPing(i),PlayerName(i));strcat(string,newstring);}}
  44.         ShowPlayerDialog(playerid,1212,DIALOG_STYLE_LIST,"  id     ping     name",string,"select","cancel");
  45.     }
  46.     else if(SCORE_ADDED == 1 && PING_ADDED == 0 && ID_ADDED == 1)
  47.     {
  48.         new string[50],newstring[50];
  49.         for(new i=0;i<MAX_PLAYERS;i++){if(IsPlayerConnected(i)){format(newstring,sizeof(newstring),"%d         %d         %s\n",i,GetPlayerScore(i),PlayerName(i));strcat(string,newstring);}}
  50.         ShowPlayerDialog(playerid,1212,DIALOG_STYLE_LIST,"  id     score     name",string,"select","cancel");
  51.     }
  52.     else if(SCORE_ADDED == 1 && PING_ADDED == 1 && ID_ADDED == 0)
  53.     {
  54.         new string[50],newstring[50];
  55.         for(new i=0;i<MAX_PLAYERS;i++){if(IsPlayerConnected(i)){format(newstring,sizeof(newstring),"%d           %d          %s\n",GetPlayerPing(i),GetPlayerScore(i),PlayerName(i));strcat(string,newstring);}}
  56.         ShowPlayerDialog(playerid,1212,DIALOG_STYLE_LIST,"  ping     score     name",string,"select","cancel");
  57.     }
  58.     else if(SCORE_ADDED == 1 && PING_ADDED == 0 && ID_ADDED == 0)
  59.     {
  60.         new string[50],newstring[50];
  61.         for(new i=0;i<MAX_PLAYERS;i++){if(IsPlayerConnected(i)){format(newstring,sizeof(newstring),"  %d           %s\n",GetPlayerScore(i),PlayerName(i));strcat(string,newstring);}}
  62.         ShowPlayerDialog(playerid,1212,DIALOG_STYLE_LIST,"  score     name",string,"select","cancel");
  63.     }
  64.     else if(SCORE_ADDED == 0 && PING_ADDED == 0 && ID_ADDED == 0)
  65.     {
  66.         new string[50],newstring[50];
  67.         for(new i=0;i<MAX_PLAYERS;i++){if(IsPlayerConnected(i)){format(newstring,sizeof(newstring),"%s\n",PlayerName(i));strcat(string,newstring);}}
  68.         ShowPlayerDialog(playerid,1212,DIALOG_STYLE_LIST,"  Playerlist: ",string,"select","cancel");
  69.     }
  70.     else if(SCORE_ADDED == 0 && PING_ADDED == 0 && ID_ADDED == 1)
  71.     {
  72.         new string[50],newstring[50];
  73.         for(new i=0;i<MAX_PLAYERS;i++){if(IsPlayerConnected(i)){format(newstring,sizeof(newstring),"%d      %s\n",i,PlayerName(i));strcat(string,newstring);}}
  74.         ShowPlayerDialog(playerid,1212,DIALOG_STYLE_LIST,"  id     name",string,"select","cancel");
  75.     }
  76.     else if(SCORE_ADDED == 0 && PING_ADDED == 1 && ID_ADDED == 0)
  77.     {
  78.         new string[50],newstring[50];
  79.         for(new i=0;i<MAX_PLAYERS;i++){if(IsPlayerConnected(i)){format(newstring,sizeof(newstring),"%d       %s\n",GetPlayerPing(i),PlayerName(i));strcat(string,newstring);}}
  80.         ShowPlayerDialog(playerid,1212,DIALOG_STYLE_LIST,"  ping     name",string,"select","cancel");
  81.     }
  82.     return 1;
  83. }
  84.  
  85.  
  86.  
  87. public OnFilterScriptExit()
  88. {
  89.     return 1;
  90. }
  91.  
  92. #else
  93.  
  94. main()
  95. {
  96.     print("\n----------------------------------");
  97.     print(" Blank Gamemode by your name here");
  98.     print("----------------------------------\n");
  99. }
  100.  
  101. #endif
  102.  
  103. public OnGameModeInit()
  104. {
  105.     // Don't use these lines if it's a filterscript
  106.     //SetGameModeText("Blank Script");
  107.     //AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  108.     return 1;
  109. }
  110.  
  111. public OnGameModeExit()
  112. {
  113.     return 1;
  114. }
  115.  
  116. public OnPlayerRequestClass(playerid, classid)
  117. {
  118.     /*SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  119.     SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  120.     SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);*/
  121.     return 1;
  122. }
  123.  
  124. public OnPlayerConnect(playerid)
  125. {
  126.     return 1;
  127. }
  128.  
  129. public OnPlayerDisconnect(playerid, reason)
  130. {
  131.     return 1;
  132. }
  133.  
  134. public OnPlayerSpawn(playerid)
  135. {
  136.     return 1;
  137. }
  138.  
  139. public OnPlayerDeath(playerid, killerid, reason)
  140. {
  141.     return 1;
  142. }
  143.  
  144. public OnVehicleSpawn(vehicleid)
  145. {
  146.     return 1;
  147. }
  148.  
  149. public OnVehicleDeath(vehicleid, killerid)
  150. {
  151.     return 1;
  152. }
  153.  
  154. public OnPlayerText(playerid, text[])
  155. {
  156.     return 1;
  157. }
  158.  
  159. // Rizard's Playerlist - I can't stop you from removing credits but if you are human then leave this line or add me to your credits list!!
  160. // GOOD LUCK WITH IT - any questions regarding this... reply in the FS topic or email: rizzy.duh@gmail.com
  161.  
  162.  
  163. public OnPlayerCommandText(playerid, cmdtext[])
  164. {
  165.     if (strcmp("/playerlist", cmdtext, true, 10) == 0)
  166.     {
  167.         ShowPlayerList(playerid);
  168.         return 1;
  169.     }
  170.     if(strcmp("/score", cmdtext, true, 10) == 0)
  171.     {
  172.         if(SCORE_ADDED == 0)
  173.         {
  174.             SCORE_ADDED = 1;
  175.             SendClientMessage(playerid,0x00FF00FF,"Score added to Playerlist");
  176.         }
  177.         else
  178.         {
  179.             SCORE_ADDED = 0;
  180.             SendClientMessage(playerid,0x00FF00FF,"Score removed from Playerlist");
  181.         }
  182.         return 1;
  183.     }
  184.     if(strcmp("/ping", cmdtext, true, 10) == 0)
  185.     {
  186.         if(PING_ADDED == 0)
  187.         {
  188.             PING_ADDED = 1;
  189.             SendClientMessage(playerid,0x00FF00FF,"Ping added to Playerlist");
  190.         }
  191.         else
  192.         {
  193.             PING_ADDED = 0;
  194.             SendClientMessage(playerid,0x00FF00FF,"Ping removed from Playerlist");
  195.         }
  196.         return 1;
  197.     }
  198.     if(strcmp("/id", cmdtext, true, 10) == 0)
  199.     {
  200.         if(ID_ADDED == 0)
  201.         {
  202.             ID_ADDED = 1;
  203.             SendClientMessage(playerid,0x00FF00FF,"ID's added to Playerlist");
  204.         }
  205.         else
  206.         {
  207.             ID_ADDED = 0;
  208.             SendClientMessage(playerid,0x00FF00FF,"ID's removed from Playerlist");
  209.         }
  210.         return 1;
  211.     }
  212.     return 0;
  213. }
  214.  
  215. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  216. {
  217.     return 1;
  218. }
  219.  
  220. public OnPlayerExitVehicle(playerid, vehicleid)
  221. {
  222.     return 1;
  223. }
  224.  
  225. public OnPlayerStateChange(playerid, newstate, oldstate)
  226. {
  227.     return 1;
  228. }
  229.  
  230. public OnPlayerEnterCheckpoint(playerid)
  231. {
  232.     return 1;
  233. }
  234.  
  235. public OnPlayerLeaveCheckpoint(playerid)
  236. {
  237.     return 1;
  238. }
  239.  
  240. public OnPlayerEnterRaceCheckpoint(playerid)
  241. {
  242.     return 1;
  243. }
  244.  
  245. public OnPlayerLeaveRaceCheckpoint(playerid)
  246. {
  247.     return 1;
  248. }
  249.  
  250. public OnRconCommand(cmd[])
  251. {
  252.     return 1;
  253. }
  254.  
  255. public OnPlayerRequestSpawn(playerid)
  256. {
  257.     return 1;
  258. }
  259.  
  260. public OnObjectMoved(objectid)
  261. {
  262.     return 1;
  263. }
  264.  
  265. public OnPlayerObjectMoved(playerid, objectid)
  266. {
  267.     return 1;
  268. }
  269.  
  270. public OnPlayerPickUpPickup(playerid, pickupid)
  271. {
  272.     return 1;
  273. }
  274.  
  275. public OnVehicleMod(playerid, vehicleid, componentid)
  276. {
  277.     return 1;
  278. }
  279.  
  280. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  281. {
  282.     return 1;
  283. }
  284.  
  285. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  286. {
  287.     return 1;
  288. }
  289.  
  290. public OnPlayerSelectedMenuRow(playerid, row)
  291. {
  292.     return 1;
  293. }
  294.  
  295. public OnPlayerExitedMenu(playerid)
  296. {
  297.     return 1;
  298. }
  299.  
  300. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  301. {
  302.     return 1;
  303. }
  304.  
  305. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  306. {
  307.     return 1;
  308. }
  309.  
  310. public OnRconLoginAttempt(ip[], password[], success)
  311. {
  312.     return 1;
  313. }
  314.  
  315. public OnPlayerUpdate(playerid)
  316. {
  317.     return 1;
  318. }
  319.  
  320. public OnPlayerStreamIn(playerid, forplayerid)
  321. {
  322.     return 1;
  323. }
  324.  
  325. public OnPlayerStreamOut(playerid, forplayerid)
  326. {
  327.     return 1;
  328. }
  329.  
  330. public OnVehicleStreamIn(vehicleid, forplayerid)
  331. {
  332.     return 1;
  333. }
  334.  
  335. public OnVehicleStreamOut(vehicleid, forplayerid)
  336. {
  337.     return 1;
  338. }
  339.  
  340. // Rizard's Playerlist - I can't stop you from removing credits but if you are human then leave this line or add me to your credits list!!
  341. // GOOD LUCK WITH IT - any questions regarding this... reply in the FS topic or email: rizzy.duh@gmail.com
  342.  
  343. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  344. {
  345.     if(dialogid == 1212)
  346.     {
  347.         if(response)
  348.         {
  349.             //script here what you want to be done when clicked on a player, the listitem = playerid
  350.             //here is an example!
  351.             new string[128];
  352.             format(string,sizeof(string),"You clicked on player: %s",PlayerName(listitem));
  353.             SendClientMessage(playerid,0xFF00FFFF,string);
  354.         }
  355.         else
  356.         {
  357.             //here is what you want to be done
  358.             //when the player presses 'cancel'
  359.             //OR escape(keyboard)
  360.         }
  361.     }
  362.     return 1;
  363. }
  364.  
  365. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  366. {
  367.     return 1;
  368. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement