30.10.2012, 08:49
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
then add two things at the bottom of your script
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
put
so our nuclear checkpoint is ready now watch what i do.
now go to
then under it remember we made checkpoint named nuclear
see i made this dialog for 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
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
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
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
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!
ok here first Download the streamer include and plugin from sa-mp.
then
Code:
#include <streamer>
Code:
public OnPlayerEnterDynamicCP(playerid, checkpointid) { return 1; } public OnPlayerLeaveDynamicCP(playerid, checkpointid) { return 1; }
know how to make team from tutorials.
here we start
define a checkpoint and create one like this.
Code:
new nuclear;
Code:
public OnGameModeInit()
Code:
nuclear = CreateDynamicCP(x,y,z,3, -1,-1,-1,100.0);
now go to
Code:
OnPlayerEnterDynamicCP(playerid, checkpointid)
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"); } }
Code:
if(gTeam[playerid] == TEAM_SU)
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; }
if player press on Russian Base the nuclear would go there and see i gave
Code:
SetTimerEx("SetNuclear1", 10000, false, "i", playerid);
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);
that bomb has exploded and player has got 10 score as a bonus and in the
Code:
CreateExplosion(x,y,z,type,radius);
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!