Author Topic: Who can help me?  (Read 3140 times)

0 Members and 1 Guest are viewing this topic.

Offline andr

  • Street Thug
  • *
  • Posts: 3
    • View Profile
Who can help me?
« on: February 24, 2013, 11:48:59 am »
command !getcar BUG
i type !getcar 130
but it's not spawn
and quit the game go in again the spawn car will appear
Sorry for my bad english
[pawn]   else if (strcmp(cmd, "!getcar", true) == 0){
      tmp = strtok(cmdtext, idx);
      new len = strlen(tmp);
      new Float:angle;
      if (!len) { format(szMsg,sizeof(szMsg),"Usage: !getcar <car/id>",tmp);
      SendClientMessage(playerid, COLOR_GREY, szMsg);return 1;}
       newvar = strval(tmp);
       if (GetPlayerMoney(playerid) >= 1800){
          if (newvar < 130 || newvar > 239) {
            format(szMsg,sizeof(szMsg),"Unable to find %s.",tmp);
            SendClientMessageToAll(COLOR_GREY, szMsg);
         } else {
            GetPlayerPos(playerid,x,y,z);
            GetPlayerFacingAngle(playerid,angle);
              newvar = CreateVehicle(newvar,x,y,z,angle,-1,-1);
              PutPlayerInVehicle(playerid,newvar);
              PutDirectlyInVehicle(playerid,newvar);
              format(szMsg,sizeof(szMsg),"Found %s.",tmp);
         }
        } else {
         SendClientMessage(playerid,COLOR_GREEN,"You don't have 1800 dollars!");
        }
        return 1;[/pawn]

Offline Fire_Head

  • Street Thug
  • *
  • Posts: 35
    • View Profile
Re: Who can help me?
« Reply #1 on: February 24, 2013, 01:31:14 pm »
Chek that

   [pawn]else if ( strcmp( cmd, "!getcar", true ) == 0 )
   {
         tmp = strtok( cmdtext, idx );
      if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "Please log-in to your account." );
      else if ( !strlen( tmp ) ) SendClientMessage( playerid, COLOR_GREEN, "USAGE: !getcar [VehicleID]" );
      else if ( !IsVehicleExist( strval( tmp ) ) ) SendClientMessage( playerid, COLOR_GREEN, "Error: Unknown Vehicle" );
      else if ( !IsVehicleOwnedShared( strval( tmp ), gPlayers[ playerid ] ) ) SendClientMessage( playerid, COLOR_GREEN, "You do not have the keys for that vehicle." );
      else
      {
         new Float:Angle;
         GetPlayerPos( playerid, x, y, z);
         GetPlayerFacingAngle( playerid,Angle);

         if ( !Angle) SendClientMessage( playerid, COLOR_GREEN, "Error: Invalid vehicle!" );

         SetVehiclePos( strval( tmp ),x+3,y+3,z,Angle);
         format( szMsg, sizeof( szMsg ), "Getting vehicle:[ %d ]", strval( tmp ) );
         SendClientMessage( playerid, COLOR_GREEN, szMsg );
      }
      return 1;
   }[/pawn]

Offline USA.Ghost

  • Street Thug
  • *
  • Posts: 42
  • Pawn Scripter, IT Professional
    • View Profile
    • NE Clan Official forum
Re: Who can help me?
« Reply #2 on: February 25, 2013, 05:10:08 pm »
Chek that

   [pawn]else if ( strcmp( cmd, "!getcar", true ) == 0 )
   {
         tmp = strtok( cmdtext, idx );
      if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "Please log-in to your account." );
      else if ( !strlen( tmp ) ) SendClientMessage( playerid, COLOR_GREEN, "USAGE: !getcar [VehicleID]" );
      else if ( !IsVehicleExist( strval( tmp ) ) ) SendClientMessage( playerid, COLOR_GREEN, "Error: Unknown Vehicle" );
      else if ( !IsVehicleOwnedShared( strval( tmp ), gPlayers[ playerid ] ) ) SendClientMessage( playerid, COLOR_GREEN, "You do not have the keys for that vehicle." );
      else
      {
         new Float:Angle;
         GetPlayerPos( playerid, x, y, z);
         GetPlayerFacingAngle( playerid,Angle);

         if ( !Angle) SendClientMessage( playerid, COLOR_GREEN, "Error: Invalid vehicle!" );

         SetVehiclePos( strval( tmp ),x+3,y+3,z,Angle);
         format( szMsg, sizeof( szMsg ), "Getting vehicle:[ %d ]", strval( tmp ) );
         SendClientMessage( playerid, COLOR_GREEN, szMsg );
      }
      return 1;
   }[/pawn]

ERROR: You have made !angle, which CAN accept invalid vehicles however, one thing, if the player EXACTLY faces the angel 0.000000 it will say Error: Invalid Vehicle To fix that, just make your own INVAL_VEH system and remove !angle



Click the Click Here button on top to earn free cash by completing offers, surveys, refer others and much more

Click here to join my clan

Offline dream

  • Street Thug
  • *
  • Posts: 7
    • View Profile
Re: Who can help me?
« Reply #3 on: February 27, 2013, 02:31:57 pm »
use this
[pawn]else if ( strcmp( cmd, "!getcar", true ) == 0 )
    {
         tmp = strtok( cmdtext, idx );
      if ( !strlen( tmp ) ) SendClientMessage( playerid, COLOR_GREEN, "USAGE: !getcar [VehicleID]" );
      else
      {
         new Float:Angle;
         GetPlayerPos( playerid, x, y, z); GetPlayerFacingAngle( playerid,Angle);
         if ( !Angle) SendClientMessage( playerid, COLOR_GREEN, "Error: Invalid vehicle!" );

         SetVehiclePos( strval( tmp ),x+3,y+3,z,Angle);
         format( szMsg, sizeof( szMsg ), "Spawning vehicle:[ %d ]", strval( tmp ) );
         SendClientMessage( playerid, COLOR_GREEN, szMsg );      }
      return 1;[/pawn]
Sorry for my bad English

Offline USA.Ghost

  • Street Thug
  • *
  • Posts: 42
  • Pawn Scripter, IT Professional
    • View Profile
    • NE Clan Official forum
Re: Who can help me?
« Reply #4 on: February 27, 2013, 03:03:12 pm »
use this
[pawn]else if ( strcmp( cmd, "!getcar", true ) == 0 )
    {
         tmp = strtok( cmdtext, idx );
      if ( !strlen( tmp ) ) SendClientMessage( playerid, COLOR_GREEN, "USAGE: !getcar [VehicleID]" );
      else
      {
         new Float:Angle;
         GetPlayerPos( playerid, x, y, z); GetPlayerFacingAngle( playerid,Angle);
         if ( !Angle) SendClientMessage( playerid, COLOR_GREEN, "Error: Invalid vehicle!" );

         SetVehiclePos( strval( tmp ),x+3,y+3,z,Angle);
         format( szMsg, sizeof( szMsg ), "Spawning vehicle:[ %d ]", strval( tmp ) );
         SendClientMessage( playerid, COLOR_GREEN, szMsg );      }
      return 1;[/pawn]


ERROR: You have made !angle, which CAN accept invalid vehicles however, one thing, if the player EXACTLY faces the angel 0.000000 it will say Error: Invalid Vehicle To fix that, just make your own INVAL_VEH system and remove !angle

 :'(-[HELP!]<<<<<<<<<<<<<<<<<



Click the Click Here button on top to earn free cash by completing offers, surveys, refer others and much more

Click here to join my clan

Offline Akcent Ohare

  • Street Thug
  • *
  • Posts: 9
  • Mature Avenue. Terminology of the World!
    • View Profile
Re: Who can help me?
« Reply #5 on: February 27, 2013, 10:19:01 pm »
ERROR: You have made !angle, which CAN accept invalid vehicles however, one thing, if the player EXACTLY faces the angel 0.000000 it will say Error: Invalid Vehicle To fix that, just make your own INVAL_VEH system and remove !angle

Or just if you say, it happens 'By Chance'. Argue can't be made on it. So, let him do whatever he wishes to. If he's still having problem, he will again ask.