Derby Help
#1

Hey guys,

I'm working on a derby script at the moment and everything is going alright up until now. I've made it so that it puts you in any available car, if none are available you are unable to join. The problem is that it seems if you /derbyjoin the cars just double up. So for every player the cars just re-add themselves. If anybody could help me with this, that would be good.

http://pastebin.com/fabf859e

Thanks
Reply
#2

you are using playerid wich will be for the player command so there will be 9 diff chances to join maybe

if you use (i) Max_Players instad of playerid that will be like a global check so pretty much your script right now
gives one player 9 diff choices to join lol

dont flame me if im wrong i took a fast look at the script its 12 am here time to go work tomorow i hope this helps

good luck
Reply
#3

Thanks for replying, I appreciate it. But I don't understand where I am supposed to use:
Quote:

(i) Max_Players

Reply
#4

alll over /derbyjoin command

playerid reffers to the player whos using the command so he will have 9 cases (cars) to join of course it wont be copied like u said
ur just givin each player 10 options to join lol

so replace the playerid's there for i wich its max_players so this will count for everyplayer maybe this fix your problem
Reply
#5

Sorry but you confused me more there :P I'm supposed to replace every [playerid] with [max_players]?
Reply
#6

no i give you an example hold on
Reply
#7

Код:
	if (strcmp(cmdtext, "/derbyjoin", true) == 0)
	{
   for(new i = 0; i < MAX_PLAYERS; i++)
   {
 		if(pInfo[playerid][Derby] == 0)
    {
			SetPlayerVirtualWorld(playerid, 999);
			SetPlayerInterior(playerid, 15);
			new string[256], name[24]; GetPlayerName(playerid,name,24);
	  	format(string,256,"%s has joined the Derby. Type /derbyjoin to join them!",name);
			SendClientMessageToAll(COLOR_WHITE,string);
    	SendClientMessage(playerid,COLOR_YELLOW,"Welcome to the Derby, please wait patiently for the derby to commence.");
    	if(IsVehicleOccupied(vehicle1))
      {
        PutPlayerInVehicle(i,vehicle2,0);
        pInfo[playerid][Derby] = 1;
      }
      else
      {
        PutPlayerInVehicle(i,vehicle1,0);
        pInfo[playerid][Derby] = 1;
      }
try tsomething like this
Reply
#8

Thanks but I experienced the same problem
Reply
#9

you need to change other player ids i gave you a hint
thats how people learn
Reply
#10

I changed all the
Код:
(playerid,vehiclex,0);
into
Код:
(i,vehiclex,0);
Do you mean there are others I have to do that aren't related to the vehicles?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)