Szerző Téma: hogy kell h pénzt vonjon le ? :D  (Megtekintve 870 alkalommal)

hogy kell h pénzt vonjon le ? :D
« Dátum: 2011. Június 18. - 19:27:45 »
0 Show voters
sziasztok, van egy ilyen parancsom és h tudom megcsinálni h pénzt vegyen le mikor elveszi a kulcsát ? :D
[pawn]if(strcmp(cmd, \"/kulcsel\", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
      tmp = strtok(cmdtext, idx);
      if(!strlen(tmp))
      {
         SendClientMessage(playerid, COLOR_GRAD2, \"HASZNÁLAT: /kulcsel [JátékosID/NévRészlet]\");
         return 1;
      }
      new para1;
      para1 = ReturnUser(tmp);
      tmp = strtok(cmdtext, idx);
      if(PlayerInfo[playerid][pLeader] == 2)
      {
          if(IsPlayerConnected(para1))
          {
              if(para1 != INVALID_PLAYER_ID)
              {
                  if(PlayerInfo[para1][pPcarkey] == 999)
                  {
                      SendClientMessage(playerid, COLOR_GREY, \"A játékosnak nincs kocsija!\");
                      return 1;
                  }
                  new nev[32];
               GetPlayerName(playerid, nev, sizeof(nev));
                  new kocsiid = PlayerInfo[para1][pPcarkey];
                  CarInfo[kocsiid][cOwned] = 0;
                     strmid(CarInfo[kocsiid][cOwner], \"Dealership\", 0, strlen(\"Dealership\"), 999);
                     new Float:x,Float:y,Float:z;
                     new Float:a;
                     GetVehiclePos(kocsiid, x, y, z);
                  GetVehicleZAngle(kocsiid, a);
                  CarInfo[kocsiid][cLocationx] = x;
                  CarInfo[kocsiid][cLocationy] = y;
                  CarInfo[kocsiid][cLocationz] = z;
                  CarInfo[kocsiid][cAngle] = a;
                  OnPropUpdate();
                  DestroyVehicle(kocsiid);
               CreateVehicle(CarInfo[kocsiid][cModel],CarInfo[kocsiid][cLocationx],CarInfo[kocsiid][cLocationy],CarInfo[kocsiid][cLocationz]+1.0,CarInfo[kocsiid][cAngle],CarInfo[kocsiid][cColorOne],CarInfo[kocsiid][cColorTwo],60000);
               GetPlayerName(para1, giveplayer, sizeof(giveplayer));
               GetPlayerName(playerid, sendername, sizeof(sendername));
               format(string, sizeof(string), \"%s elvette a kocsid kulcsát!\", nev);
               SendClientMessage(para1, COLOR_LIGHTRED, string);
               format(string, sizeof(string), \"Elvetted %s kocsikulcsát!\",giveplayer);
               SendClientMessage(playerid, COLOR_LIGHTRED, string);
               format(string, sizeof(string), \"[bandaüzenet]: %s elvette %s kocsijának a kulcsát. Kocsi ID: %d\",nev,giveplayer,kocsiid);
               ABroadCast(COLOR_RED,string,1);
               new h,mi,s,yy,m,d;
               getdate(yy,m,d);
               gettime(h,mi,s);
                   format(stringx,sizeof(stringx), \"[%d/%d/%d][%d:%d:%d] %s elvette %s kocsijának a kulcsát. Kocsi ID: %d\",yy,m,d,h,mi,s,nev,giveplayer,kocsiid);
               LoOoG(stringx);
               PlayerInfo[para1][pPcarkey] = 999;
            }
         }//not connected
      }
      else
      {
         SendClientMessage(playerid, COLOR_GRAD1, \"Nem vagy a csapat tagja!\");
      }
   }
   return 1;
}[/pawn]
nem marad el a +

Nem elérhető ZeRo

  • 4620
  • Ex Globális Moderátor
    • Profil megtekintése
hogy kell h pénzt vonjon le ? :D
« Válasz #1 Dátum: 2011. Június 18. - 19:29:47 »
+1 Show voters
[pawn]PlayerInfo[para1][pPcarkey] = 999;[/pawn]
Ez után szúrd be ezt:
[pawn]GivePlayerMoney( playerid, -x );[/pawn]
Az \'x\' helyére nyilván az összeget írod.

hogy kell h pénzt vonjon le ? :D
« Válasz #2 Dátum: 2011. Június 19. - 08:53:47 »
0 Show voters
nagyon köszönöm , de most látom h nagyon elírtam az egészet :D , tegap kicsit ittas állapotban voltam mikor írtam :D

szal pénzt adjon aki elveszi a kulcsot az kéne nekem :D

nagyon sajnálom a férreértést

Nem elérhető lusta19

  • 9084
  • £u$taÐi$znó
    • Profil megtekintése
hogy kell h pénzt vonjon le ? :D
« Válasz #3 Dátum: 2011. Június 19. - 09:00:24 »
+1 Show voters
GivePlayerMoney( playerid, Összeg);

 
Nem biztos ::|

Nem elérhető Delta

  • 159
    • Profil megtekintése
hogy kell h pénzt vonjon le ? :D
« Válasz #4 Dátum: 2011. Június 19. - 09:37:31 »
+1 Show voters
[pawn]GivePlayerMoney(playerid, -200);[/pawn]
A 200 helyett írhatsz más számot is.

hogy kell h pénzt vonjon le ? :D
« Válasz #5 Dátum: 2011. Június 19. - 13:02:15 »
0 Show voters
Idézetet írta: norbee0170 date=1308466427\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"8933\" data-ipsquote-contentclass=\"forums_Topic
nagyon köszönöm , de most látom h nagyon elírtam az egészet :D , tegap kicsit ittas állapotban voltam mikor írtam :D

szal pénzt adjon aki elveszi a kulcsot az kéne nekem :D

nagyon sajnálom a férreértést
 
szal h pénzt adjon annak aki elveszi xy-nak a kulcsát :D

Nem elérhető tyson

hogy kell h pénzt vonjon le ? :D
« Válasz #6 Dátum: 2011. Június 19. - 14:51:46 »
+1 Show voters
[pawn]if(strcmp(cmd, \"/kulcsel\", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
      tmp = strtok(cmdtext, idx);
      if(!strlen(tmp))
      {
         SendClientMessage(playerid, COLOR_GRAD2, \"HASZNÁLAT: /kulcsel [JátékosID/NévRészlet]\");
         return 1;
      }
      new para1;
      para1 = ReturnUser(tmp);
      tmp = strtok(cmdtext, idx);
      if(PlayerInfo[playerid][pLeader] == 2)
      {
          if(IsPlayerConnected(para1))
          {
              if(para1 != INVALID_PLAYER_ID)
              {
                  if(PlayerInfo[para1][pPcarkey] == 999)
                  {
                      SendClientMessage(playerid, COLOR_GREY, \"A játékosnak nincs kocsija!\");
                      return 1;
                  }
                  new nev[32];
               GetPlayerName(playerid, nev, sizeof(nev));
                  new kocsiid = PlayerInfo[para1][pPcarkey];
                  CarInfo[kocsiid][cOwned] = 0;
                     strmid(CarInfo[kocsiid][cOwner], \"Dealership\", 0, strlen(\"Dealership\"), 999);
                     new Float:x,Float:y,Float:z;
                     new Float:a;
                     GetVehiclePos(kocsiid, x, y, z);
                  GetVehicleZAngle(kocsiid, a);
                  CarInfo[kocsiid][cLocationx] = x;
                  CarInfo[kocsiid][cLocationy] = y;
                  CarInfo[kocsiid][cLocationz] = z;
                  CarInfo[kocsiid][cAngle] = a;
                  OnPropUpdate();
                  DestroyVehicle(kocsiid);
               CreateVehicle(CarInfo[kocsiid][cModel],CarInfo[kocsiid][cLocationx],CarInfo[kocsiid][cLocationy],CarInfo[kocsiid][cLocationz]+1.0,CarInfo[kocsiid][cAngle],CarInfo[kocsiid][cColorOne],CarInfo[kocsiid][cColorTwo],60000);
               GetPlayerName(para1, giveplayer, sizeof(giveplayer));
               GetPlayerName(playerid, sendername, sizeof(sendername));
               format(string, sizeof(string), \"%s elvette a kocsid kulcsát!\", nev);
               SendClientMessage(para1, COLOR_LIGHTRED, string);
               format(string, sizeof(string), \"Elvetted %s kocsikulcsát!\",giveplayer); //<- itt elveszed
               SendClientMessage(playerid, COLOR_LIGHTRED, string);
                                               GivePlayerMoney(playerid, összeg);            //<- és itt elvileg adja a beírt összeget..      
format(string, sizeof(string), \"[bandaüzenet]: %s elvette %s kocsijának a kulcsát. Kocsi ID: %d\",nev,giveplayer,kocsiid);
               ABroadCast(COLOR_RED,string,1);
               new h,mi,s,yy,m,d;
               getdate(yy,m,d);
               gettime(h,mi,s);
                   format(stringx,sizeof(stringx), \"[%d/%d/%d][%d:%d:%d] %s elvette %s kocsijának a kulcsát. Kocsi ID: %d\",yy,m,d,h,mi,s,nev,giveplayer,kocsiid);
                                                                  
LoOoG(stringx);
               PlayerInfo[para1][pPcarkey] = 999;
            }
         }//not connected
      }
      else
      {
         SendClientMessage(playerid, COLOR_GRAD1, \"Nem vagy a csapat tagja!\");
      }
   }
   return 1;
}[/pawn]
Tehát ha elveszi akkor adja a beírt összeget elvileg... Ha így gondolod
Hameg azt szeretnéd h elvegye akkor összeg helyett -akármennyit írsz pl. GivePlayerMoney(playerid, -100); De lehet más is .. Ha rosszul írtam akkor sry :/
« Utoljára szerkesztve: 2011. Június 19. - 14:53:52 írta tyson »

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal