Author Topic: [I NEW] /c buycell --- /c cell . Saved in the registration system  (Read 4979 times)

0 Members and 1 Guest are viewing this topic.

Offline · KaTaNNa ·

  • Street Thug
  • *
  • Posts: 12
  • It's easy to talk about difficult mi.Lo is be me .
    • View Profile
Hello and Merry Christmas to all the team members and the forum. Today I bring you a cmd to buy a phone and talk, saved in your system registry.

Well this is the '/ c buycell' :

[pawn]else if ( strcmp( cmd, "buycell", true ) == 0 )
   {      
      new cash = GetPlayerMoney(playerid);      
      if (GetPlayerCel(playerid) == 1) {
    SendClientMessage(playerid, GREEN,"You already have a telefono.Solo use it /c cell.");
    }
    if (GetPlayerCel(playerid) == 0) {
      if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "Please login to your account!" );            
      else if(cash < 200) {
      format( szMsg, sizeof( szMsg ), "Necesita :($%d) mas para comprar un telefono.",200 - cash);   
         SendClientMessage( playerid, COLOR_YELLOW, szMsg );
  }      
      else if (!PlayerIsArea(6, playerid, 351.2946, 1110.8674, 25.3879)) SendClientMessage( playerid, COLOR_RED, "CountDown Head to the Mall!" );   
      else
      {
         IncPlayerCel(playerid,1);
         SendClientMessage(playerid,COLOR_YELLOW,"You bought a Cellphone.Cost $200.Now use it with /c cell.");
         DecPlayerHandCash(playerid,200);
      }      
      }      
      return 1;
   }   [/pawn]

Now the '/c cell' :

[pawn]else if ( strcmp( cmd, "cell", true ) == 0 )
   {
      new plr;      
      tmp = strtok( cmdtext, idx ), plr = FindPlayerIDFromString( tmp );
      if (GetPlayerCel(playerid) == 0) {
    SendClientMessage(playerid, GREEN,"You do not have a phone. Buy it with /c buycell.");
    }
    if (GetPlayerCel(playerid) == 1) {
      if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "Please login to your account!" );      
      else if ( !strlen( tmp ) ) SendClientMessage( playerid, COLOR_GREEN, "Type: /c cell [Nick/ID] [Message]" );
      else if ( plr == INACTIVE_PLAYER_ID ) SendClientMessage( playerid, COLOR_RED, "Error: Unknown player." );         
      else
      {      
         format( szMsg, sizeof( szMsg ), "Flames by cellphone to [%s] : (%s)", gPlayers[ plr ], cmdtext[strlen(tmp)+4]);
         SendClientMessage( playerid, GREEN, szMsg );
         format( szMsg, sizeof( szMsg ), "Calling you [%s] : (%s)", gPlayers[ playerid ], cmdtext[strlen(tmp)+4]);
         SendClientMessage( plr, GREEN, szMsg );      
      }      
      }      
      return 1;
   }[/pawn]

Those are the cmds, now we need to define a few things :

[pawn]new INFO[256];//This would be near the beginning of "gm"[/pawn]

[pawn]stock PlayerIsArea(Float:radi, playerid, Float:x, Float:y, Float:z)
{
    if(IsPlayerConnected(playerid))
   {
      new Float:oldposx, Float:oldposy, Float:oldposz;
      new Float:tempposx, Float:tempposy, Float:tempposz;
      GetPlayerPos(playerid, oldposx, oldposy, oldposz);
      tempposx = (oldposx -x);
      tempposy = (oldposy -y);
      tempposz = (oldposz -z);
      if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
      {
         return 1;
      }
   }
   return 0;
}[/pawn]

[pawn]public GetPlayerCel(playerid)
{
format(INFO,256, USERS_FILE, gPlayers[playerid]);
   new tel = dini_Int(INFO,"Cellphone");
   return tel;
}[/pawn]

[pawn]public IncPlayerCel(playerid,amount)
{
    format(INFO,256, USERS_FILE, gPlayers[playerid]);
   dini_IntSet(INFO,"Cellphone", GetPlayerTel(playerid)+amount);
}[/pawn]

That's it. I hope you liked it and served .
If you think you do dificil.No back ... go ahead and face it! ;D

Offline stormeus

  • VC:MP Developer
  • VC:MP Veteran
  • *
  • Posts: 1122
    • View Profile
Re: [I NEW] /c buycell --- /c cell . Saved in the registration system
« Reply #1 on: December 26, 2012, 07:02:14 am »
Please stay on-topic when replying.
Do not PM me for support.




Offline mrockxkingbutt

  • Crime Boss
  • ****
  • Posts: 373
  • I AM Best Scripter And You Are Not :P
    • View Profile
Re: [I NEW] /c buycell --- /c cell . Saved in the registration system
« Reply #2 on: December 26, 2012, 11:40:05 am »
Good Work
and it also works in gups
(Y)
My Servers Showroom!
www.jimxvcmpscripts.createaforum.com/

Quote from:  rohanaj60
i m a great script Editor

Rofl! lmao lol

Offline · KaTaNNa ·

  • Street Thug
  • *
  • Posts: 12
  • It's easy to talk about difficult mi.Lo is be me .
    • View Profile
Re: [I NEW] /c buycell --- /c cell . Saved in the registration system
« Reply #3 on: December 26, 2012, 03:19:53 pm »
Thanks :) I always liked to be a member of this forum
If you think you do dificil.No back ... go ahead and face it! ;D

Offline aledark24

  • Made Man
  • ***
  • Posts: 206
  • I am a scripter and you have celous of me....so you crashed my servers
    • View Profile
Re: [I NEW] /c buycell --- /c cell . Saved in the registration system
« Reply #4 on: December 26, 2012, 03:22:37 pm »
se te olvido cambiar el mensaje ke necesitas 200.para comprarlo
$ 200 wtf is easy buy whit 200 of money
I am a great scripter and you are celous of my works
.....

Vice City Life Multiplayer By Saint

Offline · KaTaNNa ·

  • Street Thug
  • *
  • Posts: 12
  • It's easy to talk about difficult mi.Lo is be me .
    • View Profile
Re: [I NEW] /c buycell --- /c cell . Saved in the registration system
« Reply #5 on: December 26, 2012, 03:27:18 pm »
se te olvido cambiar el mensaje ke necesitas 200.para comprarlo
$ 200 wtf is easy buy whit 200 of money

-_-

[pawn]else if(cash < 200) {
      format( szMsg, sizeof( szMsg ), "Need: ($ %d) more to buy a phone.",200 - cash);   
         SendClientMessage( playerid, COLOR_YELLOW, szMsg );
  }      [/pawn]
If you think you do dificil.No back ... go ahead and face it! ;D

Offline mrockxkingbutt

  • Crime Boss
  • ****
  • Posts: 373
  • I AM Best Scripter And You Are Not :P
    • View Profile
Stormeus Move It To Snippet /c buycell --- /c cell
« Reply #6 on: March 18, 2014, 04:25:04 pm »
Stormeus Move It To Snippet!
My Servers Showroom!
www.jimxvcmpscripts.createaforum.com/

Quote from:  rohanaj60
i m a great script Editor

Rofl! lmao lol