[GUIDA] Come creare bot su SA-MP 0.3
#62
Inviato il 04 novembre 2009 - 18:39
OnPlayerConnect
if(IsPlayerNPC(playerid)) //Controlla se è un bot.
{
SetPlayerSpawnInfo(playerid, team, skin, Float:x, Float:y, Float:z, Float:Angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
}
sostituisci la skin con l'id ke vuoi, come team metti 0 e il resto metti tutto 0
if(IsPlayerNPC(playerid)) //Controlla se è un bot.
{
SetPlayerSpawnInfo(playerid, team, skin, Float:x, Float:y, Float:z, Float:Angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
}
sostituisci la skin con l'id ke vuoi, come team metti 0 e il resto metti tutto 0
#64
Inviato il 04 novembre 2009 - 19:40
ohsi, ma puoi escludere gli altri per il nome
#65
Inviato il 04 novembre 2009 - 19:42
ok lo scoperto devi fare cosi per esempio :
e sotto OnPlayerSpawn metti :
A me cosi funge tanto ho fatto che mi è risultato
cmq se nn ti va dimmelo!
public OnGameModeInit() { ConnectNPC("pedone","bot"); return 1; }
e sotto OnPlayerSpawn metti :
public OnPlayerSpawn(playerid) { if(IsPlayerNPC(playerid)) //Checks if the player that just spawned is an NPC. { GetPlayerName(playerid, npcname, sizeof(npcname)); if(!strcmp(npcname,"BOT",true)) { SetPlayerSkin(playerid, skin di sweet); } return 1; } return 1; }
A me cosi funge tanto ho fatto che mi è risultato

cmq se nn ti va dimmelo!
#66
Inviato il 04 novembre 2009 - 19:54
posso mettere piu cosi esempio
public OnPlayerSpawn(playerid)
{
if(IsPlayerNPC(playerid)) //Checks if the player that just spawned is an NPC.
{
GetPlayerName(playerid, npcname, sizeof(npcname));
if(!strcmp(npcname,"BOT",true)) {
SetPlayerSkin(playerid, skin di sweet);
}
return 1;
}
if(!strcmp(npcname,"UnAltroBOT",true)) {
SetPlayerSkin(playerid, UnAltraSkin);
}
return 1;
}
return 1;
}
public OnPlayerSpawn(playerid)
{
if(IsPlayerNPC(playerid)) //Checks if the player that just spawned is an NPC.
{
GetPlayerName(playerid, npcname, sizeof(npcname));
if(!strcmp(npcname,"BOT",true)) {
SetPlayerSkin(playerid, skin di sweet);
}
return 1;
}
if(!strcmp(npcname,"UnAltroBOT",true)) {
SetPlayerSkin(playerid, UnAltraSkin);
}
return 1;
}
return 1;
}
#67
Inviato il 05 novembre 2009 - 19:02
si, certo...
#69
Inviato il 05 novembre 2009 - 20:29
quella col casco
260

#78
Inviato il 13 novembre 2009 - 19:02
devi fare due registrazioni separate e mettere questo
#define RECORDINGp "a piedi" #define RECORDINGa "con auto" #include <a_npc> main(){} public OnRecordingPlaybackEnd() { StartRecordingPlayback(2, RECORDINGp); // ripete il movimento dei bot } public OnNPCEnterVehicle(vehicleid, seatid) { StartRecordingPlayback(1, RECORDINGa); public OnNPCExitVehicle() { StopRecordingPlayback(); //quando esce si ferma } public OnNPCSpawn() { StartRecordingPlayback(2 ,RECORDINGp); }
#80
Inviato il 13 novembre 2009 - 19:46
al contrario credo di si, bho prova