Mission Active Problem.
#1

On Top of the Script:

new IsPamActive;
new PAMJet;
new BaseJump;
new Minigun;

So here's the Command:

CMDam(playerid,params[])
#pragma unused params
{
if(gTeam[playerid] == Army)
{
if(GetPlayerMoney(playerid) < 49999)
{
SendClientMessage(playerid,COLOR_RED,"You Need 50000 $ to go on a Private Assault Mission PAM)");
return 1;
}
else if(GetPlayerMoney(playerid) >=49999)
{
if(IsPamActive == 0)
{
IsPamActive == 1;
SetTimerEx("Jump", 20000, false,"d",playerid);
GivePlayerMoney(playerid,-50000);
SetPlayerPos(playerid,-571.46655, 1904.66785, 156.10655);
GivePlayerWeapon(playerid, 46, 1);
TogglePlayerControllable(playerid,0);
PAMJet = CreateObject(1681, -570.79047, 1903.33215, 156.98834, 0.00000, 0.00000, 329.83246);
BaseJump = CreateObject(2978, -571.46655, 1904.66785, 156.10655, 0.00000, 0.00000, 331.89856);
Minigun = CreateObject(2985, -571.37244, 1904.87830, 156.08437, 0.00000, 0.00000, 73.55220);
MoveObject(PAMJet,278.4110, 3240.0339, 156.9883,15);
MoveObject(BaseJump,277.69675, 3241.26929, 156.00011,15);
MoveObject(Minigun,277.57187, 3241.61841, 156.00830,15);
SetTimer("DestroyObjects",30000,0);
}
}
else if(gTeam[playerid] == Terrorists)
{
SendClientMessage(playerid,COLOR_RED,"The Private Assault Mission (PAM) is only avaible for Armys");
}
else if(IsPamActive == 1)
{
SendClientMessage(playerid,COLOR_RED,"A Private Assault Mission (PAM) is already goin on.");
}
}
return 1;
}


//---------------------------------------Several Timers--------------------------------//

forward Jump(playerid);
public Jump(playerid)
{
new Float,Float:y,Float:z;
GetPlayerPos(playerid,Float,Float:y,Float:z);
SetPlayerPos(playerid,x,y,170.2089);
TogglePlayerControllable(playerid,1);
GameTextForPlayer(playerid,"~r~JUMP!", 2000, 3);
GivePlayerWeapon(playerid, 46, 1);
return 1;
}

forward DestroyObjects();
public DestroyObjects()
{
SendClientMessageToAll(0xFFFFFF,"PAM available again !");
DestroyObject(PAMJet);
DestroyObject(BaseJump);
DestroyObject(Minigun);
IsPamActive == 0;
return 1;
}

-----------------------------------------------------------------------------------------
It compiles without problems but it doesn't work. If someone types the Cmd he himself can go on the mission again even if it's not avaible yet same as all other players. I hope you can help me. Thanks for reading
Reply


Messages In This Thread
Mission Active Problem. - by StormDust - 16.08.2013, 14:46
Re: Mission Active Problem. - by feartonyb - 16.08.2013, 14:54
Re: Mission Active Problem. - by StormDust - 16.08.2013, 15:07
Re: Mission Active Problem. - by StormDust - 16.08.2013, 15:12

Forum Jump:


Users browsing this thread: 3 Guest(s)