Guest User

Rizard

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