15.10.2012, 18:44
hey everyone,
im trying to create a bot and puts it in a vehicle when someone does /test, but instead of putting the bot in the car, it puts me or another player in the car...
anyways this is my code:
does anyone sees wuts wrong in this code?
greets niels
im trying to create a bot and puts it in a vehicle when someone does /test, but instead of putting the bot in the car, it puts me or another player in the car...
anyways this is my code:
pawn Code:
public OnGameModeInit()
{
SetGameModeText("StreetRodzRacers");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
FirstRaceBotVehicle = CreateVehicle(517,2656.8381,-2005.3379,13.0751,0,0,0,-1);
FirstRaceBot = ConnectNPC( "FirstRaceBot", "npcdriver" );
return 1;
}
pawn Code:
CMD:test(playerid, params[])
{
SetPlayerRaceCheckpoint(playerid, 0, -1714.984741, 1027.797485, 45.036315, -1725.589111, 926.632080, 24.717582, 10.0);
CheckPointID++;
SendClientMessage(playerid, 0xFF0000FF, "test started");
PutPlayerInVehicle(FirstRaceBot, FirstRaceBotVehicle, 0);
WaitForBot(FirstRaceBot, FIRSTRACE, "startfirstrace");
return 1;
}
pawn Code:
WaitForBot( playerid, menu, action[] )
{
PlayerInfo[playerid][botready] = false;
SendClientMessage(FirstRaceBot, COLOR_GREEN, action );
PlayerInfo[playerid][waitingforbot] = SetTimerEx("WaitForBotTimer",250,true,"dd",playerid,menu );
return 1;
}
public WaitForBotTimer( playerid, menu )
{
if( PlayerInfo[playerid][botready] ) // This is handled inside npcdriver.pwn
{
KillTimer(PlayerInfo[playerid][waitingforbot]);
switch(menu)
{
case FIRSTRACE:
{
}
}
}
return 1;
}
greets niels