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
#2

Change IsPamActive == 1; and IsPamActive == 0; to IsPamActive = 1; and IsPamActive = 0;
Reply
#3

Done that, getting 3 warnings now and ingame after typing /pam nothing happens. Warnings are these lines:

(610) : warning 211: possibly unintended assignment : if(IsPamActive = 0)
(632) : warning 211: possibly unintended assignment : else if(IsPamActive = 1)
(660) : warning 204: symbol is assigned a value that is never used: "IsPamActive": IsPamActive = 0;
Reply
#4

Nevermind, my mistake. The if(IsPamActive... ) had to stay with == , just the message doesn't work if on mission and doing it while not abvaible again. I guess simple problem. Thank you very much :$
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)