ok here it is: i have timers for npc 4 rc tanks right? what the timers do is creates explosions in front my 4 rc tanks. but the explosions r only creating for the ID 0 which is my barron. any solution?
Код:
#include <a_samp>
#include <a_npc>
#define FILTERSCRIPT
new Barronr1;
new Barronr2;
new Banditr1;
new Banditr2;
new Goblinr1;
new Goblinr2;
new Raiderr1;
new Raiderr2;
new Tankr1;
new Tankr2;
public OnFilterScriptInit(){
print(" _______________________________");
print("| LOADING... |");
print("| RC BOTS |");
print("| By Troy Version 1.00 |");
print("|_______________________________|");
ConnectNPC("Barrond1","Barron1");
ConnectNPC("Barrond2","Barron2");
ConnectNPC("Banditd1","Bandit1");
ConnectNPC("Banditd2","Bandit2");
ConnectNPC("Goblind1","Goblin1");
ConnectNPC("Goblind2","Goblin2");
ConnectNPC("Raiderd1","Raider1");
ConnectNPC("Raiderd2","Raider2");
ConnectNPC("Tankd1","Tank1");
ConnectNPC("Tankd2","Tank2");
Barronr1 = CreateVehicle(464,-1004.2155,994.8294,1411.7723,205.4225,1,1,1);
Barronr2 = CreateVehicle(464,-1004.2155,994.8294,1411.7723,205.4225,1,1,1);
Banditr1 = CreateVehicle(564,-1004.2155,994.8294,1411.7723,205.4225,1,1,1);
Banditr2 = CreateVehicle(564,-1004.2155,994.8294,1411.7723,205.4225,1,1,1);
Goblinr1 = CreateVehicle(501,-1004.2155,994.8294,1411.7723,205.4225,1,1,1);
Goblinr2 = CreateVehicle(501,-1004.2155,994.8294,1411.7723,205.4225,1,1,1);
Raiderr1 = CreateVehicle(465,-1004.2155,994.8294,1411.7723,205.4225,1,1,1);
Raiderr2 = CreateVehicle(465,-1004.2155,994.8294,1411.7723,205.4225,1,1,1);
Tankr1 = CreateVehicle(564,-1004.2155,994.8294,1411.7723,205.4225,1,1,1);
Tankr2 = CreateVehicle(564,-1004.2155,994.8294,1411.7723,205.4225,1,1,1);
LinkVehicleToInterior(Barronr1, 10);
LinkVehicleToInterior(Barronr2, 10);
LinkVehicleToInterior(Banditr1, 10);
LinkVehicleToInterior(Banditr2, 10);
LinkVehicleToInterior(Goblinr1, 10);
LinkVehicleToInterior(Goblinr2, 10);
LinkVehicleToInterior(Raiderr1, 10);
LinkVehicleToInterior(Raiderr2, 10);
LinkVehicleToInterior(Tankr1, 10);
LinkVehicleToInterior(Tankr2, 10);
}
public OnPlayerSpawn(playerid)
{
if(IsPlayerNPC(playerid))
{
new npcname[MAX_PLAYER_NAME];
GetPlayerName(playerid, npcname, sizeof(npcname));
if(!strcmp(npcname,"Barrond1",true)) {
PutPlayerInVehicle(playerid, Barronr1, 0);
LinkVehicleToInterior(Barronr1, 10);
SetPlayerColor(playerid,0xFF000050);
SetPlayerSkin(playerid,287);
return 1;
}
if(!strcmp(npcname,"Barrond2",true)) {
PutPlayerInVehicle(playerid, Barronr2, 0);
LinkVehicleToInterior(Barronr2, 10);
SetPlayerColor(playerid,0xFF000050);
SetPlayerSkin(playerid,287);
return 1;
}
if(!strcmp(npcname,"Banditd1",true)) {
PutPlayerInVehicle(playerid, Banditr1, 0);
SetPlayerColor(playerid,0xFF000050);
LinkVehicleToInterior(Banditr1, 10);
SetPlayerColor(playerid,0xFF000050);
SetPlayerSkin(playerid,287);
SetTimer("exploding1",5000,true);
return 1;
}
if(!strcmp(npcname,"Banditd2",true)) {
PutPlayerInVehicle(playerid, Banditr2, 0);
LinkVehicleToInterior(Banditr2, 10);
SetPlayerColor(playerid,0xFF000050);
SetPlayerSkin(playerid,287);
SetTimer("exploding2",5000,true);
return 1;
}
if(!strcmp(npcname,"Goblind1",true)) {
PutPlayerInVehicle(playerid, Goblinr1, 0);
LinkVehicleToInterior(Goblinr1, 10);
SetPlayerColor(playerid,0xFF000050);
SetPlayerSkin(playerid,287);
return 1;
}
if(!strcmp(npcname,"Goblind2",true)) {
PutPlayerInVehicle(playerid, Goblinr2, 0);
LinkVehicleToInterior(Goblinr2, 10);
SetPlayerColor(playerid,0xFF000050);
SetPlayerSkin(playerid,287);
return 1;
}
if(!strcmp(npcname,"Raiderd1",true)) {
PutPlayerInVehicle(playerid, Raiderr1, 0);
LinkVehicleToInterior(Raiderr1, 10);
SetPlayerColor(playerid,0xFF000050);
SetPlayerSkin(playerid,287);
return 1;
}
if(!strcmp(npcname,"Raiderd2",true)) {
PutPlayerInVehicle(playerid, Raiderr2, 0);
LinkVehicleToInterior(Raiderr2, 10);
SetPlayerColor(playerid,0xFF000050);
SetPlayerSkin(playerid,287);
return 1;
}
if(!strcmp(npcname,"Tankd1",true)) {
PutPlayerInVehicle(playerid, Tankr1, 0);
LinkVehicleToInterior(Tankr1, 10);
SetPlayerColor(playerid,0xFF000050);
SetPlayerSkin(playerid,287);
SetTimer("exploding3",5000,true);
return 1;
}
if(!strcmp(npcname,"Tankd2",true)) {
PutPlayerInVehicle(playerid, Tankr2, 0);
LinkVehicleToInterior(Tankr1, 10);
SetPlayerColor(playerid,0xFF000050);
SetPlayerSkin(playerid,287);
SetTimer("exploding4",5000,true);
return 1;
}
return 1;
}
return 1;
}
forward exploding1(playerid);
public exploding1(playerid){
new Float:x,Float:y,Float:z,Float:x2,Float:y2,Float:az;
GetPlayerPos(playerid,x,y,z);
GetVehicleZAngle(GetPlayerVehicleID(playerid), az);
x2 = x + (15 * floatsin(-az+5, degrees));
y2 = y + (30 * floatcos(-az+5, degrees));
CreateExplosion(x2,y2,z,3,4.0);
return 1;}
forward exploding2(playerid);
public exploding2(playerid){
new Float:x,Float:y,Float:z,Float:x2,Float:y2,Float:az;
GetPlayerPos(playerid,x,y,z);
GetVehicleZAngle(GetPlayerVehicleID(playerid), az);
x2 = x + (15 * floatsin(-az+5, degrees));
y2 = y + (30 * floatcos(-az+5, degrees));
CreateExplosion(x2,y2,z,3,4.0);
return 1;}
forward exploding3(playerid);
public exploding3(playerid){
new Float:x,Float:y,Float:z,Float:x2,Float:y2,Float:az;
GetPlayerPos(playerid,x,y,z);
GetVehicleZAngle(GetPlayerVehicleID(playerid), az);
x2 = x + (15 * floatsin(-az+5, degrees));
y2 = y + (30 * floatcos(-az+5, degrees));
CreateExplosion(x2,y2,z,3,4.0);
return 1;}
forward exploding4(playerid);
public exploding4(playerid){
new Float:x,Float:y,Float:z,Float:x2,Float:y2,Float:az;
GetPlayerPos(playerid,x,y,z);
GetVehicleZAngle(GetPlayerVehicleID(playerid), az);
x2 = x + (15 * floatsin(-az+5, degrees));
y2 = y + (30 * floatcos(-az+5, degrees));
CreateExplosion(x2,y2,z,3,4.0);
return 1;}