First of all you need to know how to make a checkpoint with a streamer include to make it!
ok here first Download the streamer include and plugin from sa-mp.
then
Code:
#include <streamer>
then add two things at the bottom of your script
Code:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
return 1;
}
public OnPlayerLeaveDynamicCP(playerid, checkpointid)
{
return 1;
}
these are the checkpoint maker for streamer so suppose i have 2 teams named SU and RF and you also must
know how to make team from tutorials.
here we start
define a checkpoint and create one like this.
then at
Code:
public OnGameModeInit()
put
Code:
nuclear = CreateDynamicCP(x,y,z,3, -1,-1,-1,100.0);
so our nuclear checkpoint is ready now watch what i do.
now go to
Code:
OnPlayerEnterDynamicCP(playerid, checkpointid)
then under it remember we made checkpoint named nuclear
Code:
if(checkpointid == nuclear)
{
if(gTeam[playerid] == TEAM_SU)
{
ShowPlayerDialog(playerid, 1111, DIALOG_STYLE_LIST, "{6EF83C}Choose Your Nuclear Place:", "Russian Base","Choose","Close");
}
else
{
SendClientMessage(playerid, COLOR_RED,"This is not your team's nuclear menu");
}
}
see i made this dialog for TEAM_SU
Code:
if(gTeam[playerid] == TEAM_SU)
this code defines that only
if the player's team is SU then he can get this dialog if he stands on the checkpoint and the checkpoint name is
nuclear so similarly SU = Soviet Union and RF = Russian force now we need to know how to explode the bomb?
yeah coming to the final step
Code:
if(dialogid == 1111)//dialog id response
{
if(response)
{
if(listitem == 0)
{
if(GetPlayerMoney(playerid) >= 350000)
{
SendClientMessageToAll(COLOR_WHITE,"Server News: Warning! a Nuclear Bomb is on its way to Russian Base");
SetTimerEx("SetNuclear1", 10000, false, "i", playerid);
GivePlayerMoney(playerid, -350000);
}
else
{
SendClientMessage(playerid, COLOR_RED,"You don't have enough cash to launch a nuclear bomb!");
}
}
return 1;
}
you might be thinking why i used this?? this is because we have given the dialog but not its feature yet so
if player press on Russian Base the nuclear would go there and see i gave
Code:
SetTimerEx("SetNuclear1", 10000, false, "i", playerid);
this is because after 10 seconds the SetNuclear1 will happen the thing that is coded
in setnuclear1 will happen after 10 seconds so we have to give timer like that and also if player has 350 k then he
can only use the nuclear or error message will be sent.
now coming to the last final
step that is making the feature of the setnuclear1
Code:
forward SetNuclear1(playerid);
public SetNuclear1(playerid)
{
SetPlayerScore(playerid, GetPlayerScore(playerid) + 10);
SendClientMessage(playerid, COLOR_ORANGE,"You have got 10 score as you launched a nuclear explosion!");
CreateExplosion(x,y,z,type,radius);//RF
return 1;
}
Code:
SetPlayerScore(playerid, GetPlayerScore(playerid) + 10);
everyone knows this thing after bomb successfully blast player will get 10 score as a bonus so thats why we used this code and we are sending message
that bomb has exploded and player has got 10 score as a bonus and in the
Code:
CreateExplosion(x,y,z,type,radius);
i gave like this becasue you put in your own type of explosion and radius with your position for where the bomb
will blast like this you can do many bombs and at last we are done making our successful Nuclear System!
Thanks for watching the Tutorial hope you can make it!
Re: How To Make A Nuclear System | For TDM | DM | Explained! - Jarnu - 30.10.2012
Re: How To Make A Nuclear System | For TDM | DM | Explained! - Jarnu - 30.10.2012
-Not well explained.
-Horrible indentation of codes.
-Not used proper english.
It should be thanks for reading the tutorial hope you learnt something from it.
And giving 10 scores for free is useless. player can use the bomb thousand times and get about 10000 scores.
You are not temp-disabling the nuclear launch which leads to excessive abuse.
Re: How To Make A Nuclear System | For TDM | DM | Explained! - Glint - 30.10.2012
Re: How To Make A Nuclear System | For TDM | DM | Explained! - Glint - 30.10.2012
Did you know there are max. 10 explosions? This is not efficient, it will just create a small explosion as far i know. You should be more creative, use IsPlayerInZone, some textdraws, or another efficient way.