Hi. Recently i wanted to add some train bots to my server. Bots are connecting, spawning and they are driving the trains for about 30 seconds and then they are dissapearing. After that, again for 30 second they are moved to trains and all situation is beaing repeated all time.
Код:
public OnPlayerRequestClass(playerid, classid)
{
if(IsPlayerNPC(playerid))
{
if(!strcmp(PlayerName(playerid), "[TWBOT]Czesiek", false))
{
SetSpawnInfo(playerid, 0, 0, 1462.0745, 2630.8787, 10.8203, 0.0, 0, 0, 0, 0, 0, 0);
}
else if(!strcmp(PlayerName(playerid), "[TWBOT]Bogdan", false))
{
SetSpawnInfo(playerid, 0, 0, -1942.7950, 168.4164, 27.0006, 0.0, 0, 0, 0, 0, 0, 0);
}
else if(!strcmp(PlayerName(playerid), "[TWBOT]Szefuniu", false))
{
SetSpawnInfo(playerid, 0, 0, 1700.7551, -1953.6531, 14.8756, 0.0, 0, 0, 0, 0, 0, 0);
}
return 1;
}
return 0;
}
Код:
if(IsPlayerNPC(playerid))
{
if(!strcmp(PlayerName(playerid), "[TWBOT]Czesiek", false))
{
PutPlayerInVehicle(playerid, czesiek, 0);
SetPlayerColor(playerid, COLOR_TRUCKERS);
}
else if(!strcmp(PlayerName(playerid), "[TWBOT]Bogdan", false))
{
PutPlayerInVehicle(playerid, bogdan, 0);
SetPlayerColor(playerid, COLOR_TRUCKERS);
}
else if(!strcmp(PlayerName(playerid), "[TWBOT]Szefuniu", false))
{
PutPlayerInVehicle(playerid, szefuniu, 0);
SetPlayerColor(playerid, COLOR_TRUCKERS);
}
}