Advertisement
Guest User

Untitled

a guest
Feb 6th, 2012
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. ocmd:f(playerid,params[])
  2. {
  3. new fraction = GetPVarInt(playerid,"Fraktion");
  4. if(getFractionType(fraction) == 2)
  5. {
  6. if(sscanf(params,"s",text)) return SendClientMessage(playerid,COLOR_GRAU,"/f [text]");
  7. new text[128];
  8. format(text,sizeof(text),"Fraktionsmember %s: %s",SpielerName(playerid),text);
  9. sendFractionMessage(frak,text);
  10. }
  11. return 1;
  12. }
  13. forward getFractionType(fraction);
  14. public getFractionType(fraction)
  15. {
  16. // return 1 für Staat
  17. // return 2 für Mafia
  18. if(fraction == 1) return 1;
  19. if(fraction == 2) return 1;
  20. if(fraction == 3) return 2;
  21. if(fraction == 4) return 2;
  22. if(fraction == 5) return 2;
  23. if(fraction == 6) return 2;
  24. if(fraction == 7) return 2;
  25. if(fraction == 8) return 2;
  26. if(fraction == 9) return 2;
  27. if(fraction == 10) return 2;
  28. if(fraction == 11) return 1;
  29. if(fraction == 12) return 2;
  30. return 0;
  31. }
  32. forward sendFractionMessage(fraction,text[]);
  33. public sendFractionMessage(fraction,text[])
  34. {
  35. for(new i=0; i<GetMaxPlayers(); i++)
  36. {
  37. if(IsPlayerConnected(i))
  38. {
  39. if(isPlayerInFrakt(i,fraction))
  40. {
  41. SendClientMessage(i, COLOR_GANGFARBE, text);
  42. }
  43. }
  44. }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement