Author Topic: little problem ++++Click++++  (Read 2365 times)

0 Members and 1 Guest are viewing this topic.

Offline [Tkiller]

  • Street Thug
  • *
  • Posts: 15
    • View Profile
little problem ++++Click++++
« on: February 26, 2012, 07:58:42 am »
[pawn]   else if (strcmp(cmd, "!race", true) == 0)
   {
   tmp = strtok(cmdtext, idx);
      if (!strlen(tmp)) {
      SetPlayerPos(playerid,-1051.5901,321.7699,10.7553);
        ResetPlayerWeapons(playerid);
        PutPlayerInVehicle(playerid,100);
        PutPlayerInVehicle(playerid,101);
        PutPlayerInVehicle(playerid,102);
        PutPlayerInVehicle(playerid,103);
        SendClientMessageToAll(GREEN, "Wait 10 seconds for more players");
      format( szMsg, 128, "%s is now on racetrack, type !race for race with him",gPlayers[playerid]);
       SendClientMessageToAll( RED, szMsg );
       GameTextForAllBottom("~g~End ~g~On ~g~Malibu!");
      }
      return 1;
   }[/pawn]




I make a race command like this...
when player type race the automatically put in vehicle,but the problem is that players only put in first vehicles not others vehicles....
so what can id o for this...
and when they finish race,then other player type race so they wont go on racetrack they directly put in vehicle of where the race ends,not on racetrack....

Offline DilsonTB

  • Made Man
  • ***
  • Posts: 140
  • VC:MP Developer. & SA:MP Currently Developer
    • View Profile
Re: little problem ++++Click++++
« Reply #1 on: February 26, 2012, 03:39:02 pm »
In pawn this is a Problem, cuz when a player in already in vehicle PuttoAnotherVehicle wont work so try this:

[pawn]   else if (strcmp(cmd, "!race", true) == 0)
   {
   tmp = strtok(cmdtext, idx);
      if (!strlen(tmp)) {
   SetPlayerPos(playerid,-1051.5901,321.7699,10.7553,0,0); // And also you need to add ,0,0
        ResetPlayerWeapons(playerid);
        PutPlayerInVehicle(playerid,100);
        RemovePlayerFromVehicle(playerid);
        PutPlayerInVehicle(playerid,101);
        RemovePlayerFromVehicle(playerid);
        PutPlayerInVehicle(playerid,102);
        RemovePlayerFromVehicle(playerid);
        PutPlayerInVehicle(playerid,103);
        SendClientMessageToAll(GREEN, "Wait 10 seconds for more players");
      format( szMsg, 128, "%s is now on racetrack, type !race for race with him",gPlayers[playerid]);
       SendClientMessageToAll( RED, szMsg );
       GameTextForAllBottom("~g~End ~g~On ~g~Malibu!");
      }
      return 1;
   }[/pawn]

The other thing that i dont understand is: Why the player must enter to 3 vehicles before race?

 
_______________________________________________
¬ 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 [Tkiller]

  • Street Thug
  • *
  • Posts: 15
    • View Profile
Re: little problem ++++Click++++
« Reply #2 on: February 27, 2012, 07:40:50 am »
Thanks so much.... :D