Author Topic: I need Money for !gotoloc  (Read 2870 times)

0 Members and 1 Guest are viewing this topic.

Offline Riders

  • Street Thug
  • *
  • Posts: 16
    • View Profile
I need Money for !gotoloc
« on: September 24, 2012, 04:21:44 pm »
Can you guys share me your !gotoloc i has it but i need money Eg:500 to gotoloc can u fix it pls..
[pawn]   else if ( strcmp( cmd, "!gotoloc", true ) == 0 )
   {
      tmp = strtok( cmdtext, idx );
      if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_WHITE, "Please log-in to your account." );
      else if ( !IsAuthorized( playerid, cmd ) ) SendClientMessage( playerid, COLOR_WHITE, "Sorry,You don't have access to use this command!" );
      else if ( !strlen( tmp ) ) SendClientMessage( playerid, COLOR_YELLOW, "USAGE: !gotoloc [Name]" );
      else
      {
          new splitx[ 3 ][ 128 ], szMsg[ 128 ];
          if ( !IsLocationExist( tmp ) )
         {
             format( szMsg, sizeof( szMsg ), "Location:[ %s ] does not exist.", tmp );
            SendClientMessage( playerid, COLOR_YELLOW, szMsg );
            return 1;
          }
          split( dini_Get( "/SavedLocations/Locations.ini", tmp ), splitx, ' ' );

          SetPlayerPos( playerid, floatstr( splitx[ 0 ] ), floatstr( splitx[ 1 ] ), floatstr( splitx[ 2 ] ), 0, 0 );
          format( szMsg, sizeof( szMsg ), "Teleporting to location:[ %s ]", tmp );
         SendClientMessage( playerid, COLOR_YELLOW, szMsg );
         
  }
      return 1;
       }[/pawn]

Offline DilsonTB

  • Made Man
  • ***
  • Posts: 140
  • VC:MP Developer. & SA:MP Currently Developer
    • View Profile
Re: I need Money for !gotoloc
« Reply #1 on: September 24, 2012, 05:44:43 pm »
just need to add a condition like this:

else if(hismoney <= here_will_go_the_amount_in_this_case_500) Send A Message if he doesnt have the money.  :D
_______________________________________________
¬ VC:MP Squirrel Developer.
¬ VC:MP pawno Developer.
¬ SA:MP Developer.
¬
¬ Actually developing " San Fierro Roleplay - Latino ", with
my beta team testers, Mapper + Scripter ( me ), 18,000
lines, and is 34% finished. hope to finish it in 4 Or 3 Months.

- MYSQL FULL BASED.
- PCU.
_______________________________________________

Offline Riders

  • Street Thug
  • *
  • Posts: 16
    • View Profile
Re: I need Money for !gotoloc
« Reply #2 on: September 24, 2012, 06:00:35 pm »
but whr to paste it ? :(

Thankyou for sharing.

Offline kitt85711

  • Wiseguy
  • **
  • Posts: 72
    • View Profile
Re: I need Money for !gotoloc
« Reply #3 on: September 25, 2012, 07:14:39 am »
Well it's kind of obvious that you past it with the rest of the else ifs. Its got to be behind the if and not further than the else.

[pawn]if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_WHITE, "Please log-in to your account." );
      else if ( !IsAuthorized( playerid, cmd ) ) SendClientMessage( playerid, COLOR_WHITE, "Sorry,You don&#039;t have access to use this command!" );
      else if ( !strlen( tmp ) ) SendClientMessage( playerid, COLOR_YELLOW, "USAGE: !gotoloc [Name]" );
      else[/pawn]