Duble command
#1

Hi
I wonder why I have to type command twice to tp to derby ??
Please Help! =)

Код:
CMD:derby(playerid,params[])
{
for(new x; x < 6; x++)
{
SetPlayerVirtualWorld(playerid,23);
if(DerbyVehicle[x][occupied]) continue;
PutPlayerInVehicle(playerid, DerbyVehicle[x][id], 0);
DerbyVehicle[x][occupied] = true;
break;
}
return 1;
}
Reply
#2

PHP код:
CMD:derby(playerid,params[])
{
for(new 
06x++)
{
SetPlayerVirtualWorld(playerid,23);
if(
DerbyVehicle[x][occupied]) continue;
PutPlayerInVehicle(playeridDerbyVehicle[x][id], 0);
DerbyVehicle[x][occupied] = true;
break;
}
return 
1;

try this, you neeeded to define x before you use it. That's why you have to type twice.
Reply
#3

Quote:
Originally Posted by ThatThoseTheThy
Посмотреть сообщение
PHP код:
CMD:derby(playerid,params[])
{
for(new 
06x++)
{
SetPlayerVirtualWorld(playerid,23);
if(
DerbyVehicle[x][occupied]) continue;
PutPlayerInVehicle(playeridDerbyVehicle[x][id], 0);
DerbyVehicle[x][occupied] = true;
break;
}
return 
1;

try this, you neeeded to define x before you use it. That's why you have to type twice.
You literally changed nothing.......

The problem here is, the vehicle 'DerbyVehicle[x][id]' doesn't exist, so when you do the command again, it goes to the next derby vehicle and that one might exist. That's why it seems like you need to do it twice.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)