Advertisement
DrPawn

Equ Pos Beispiel

Aug 8th, 2012
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. new Float:EinZahlPos[][3]=
  2. {
  3. {X,Y,Z},
  4. {X,Y,Z},
  5. {X,Y,Z}
  6. };
  7.  
  8. stock IstBeiEinzahlPos(playerid)
  9. {
  10. for(new p=0;p< sizeof EinZahlPos;p++)
  11. {
  12. if(IsPlayerInRangeOfPoint(playerid,2.1,EinZahlPos[p][0],EinZahlPos[p][1],EinZahlPos[p][2]))
  13. {
  14. return 1;
  15. }
  16. }
  17. return 0
  18. }
  19. ocmd:einzahlen(playerid ,params[])
  20. {
  21. new einzahlsumme,string[128];
  22. if(!IstBeiEinzahlPos(playerid)) return SendClientMessage(playerid,ROT,"Du kannst hier nicht einzahlen");
  23. if(sscanf(params,"i",einzahlsumme))return SendClientMessage(playerid,GRAU,"/einzahlen [Summe]");
  24. if(einzahlsumme > GetPlayerMoney(playerid))return SendClientMessage(playerid,BLAU, "Falsche Summe");
  25. else
  26. {
  27. SetPVarInt(playerid,"Kontostand",GetPVarInt(playerid,"Kontostand") +einzahlsumme);
  28. format(string, sizeof(string),"{F0F0F0}Du hast {00FFBE}%i Euro {F0F0F0}Eingezahlt, {F0F0F0}Dein neuer Kontostand: {00FFBE}%i Euro",einzahlsumme, GetPVarInt(playerid,"Kontostand"));
  29. SendClientMessage(playerid,WEIS,string);
  30. GivePlayerMoney(playerid,-einzahlsumme);
  31. SpielerSpeichern(playerid);
  32. }
  33. return 1;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement