15.08.2014, 21:00
(
Last edited by kamiliuxliuxliux; 15/08/2014 at 10:24 PM.
)
Hello, I've created new firework system and when player types /fw a timer starts... Everything is below.
So is there any ways to change the value of public parameters?
pawn Code:
CMD:fw(playerid)
{
PutFW(playerid, 1) // stock is below
return 1;
}
stock PutFW(playerid, fwid)
{
if(fwInfo[playerid][fwid-1][able] == 1)
{
fwInfo[playerid][fwid-1][able] = 0;
new Float:fd[3];
GetPlayerPos(playerid, fd[0],fd[1],fd[2]);
SetTimerEx("FW",5000,false,"iiifff",playerid,fwid,0,fd[0],fd[1],fd[2]); // a timer starts for 5 seconds
fwInfo[playerid][fwid-1][obj_id] = CreateObject(1252,fd[0],fd[1],fd[2],0,0,0);
SCM(playerid, COLOR_WHITE, " * You've put a dynamite!");
}
return 1;
}
public FW(playerid, fwid,cnt,Float:x,Float:y,Float:z) // public FW function
{
if(fwid == 1)
{
if(cnt == 0) {
GetObjectPos(fwInfo[playerid][fwid-1][obj_id],x,y,z); // here I want to change public's parameters x,y and z, but it's not changing.
DestroyObject(fwInfo[playerid][fwid-1][obj_id]); }
if(cnt == 0 || (cnt > 0 && cnt < 50)) {CreateExplosion(x,y,z,12,5.0); SetTimerEx("FW",200,false,"iiifff",playerid,fwid,cnt+1,x,y,z);}
else if(cnt == 50)
{
fwInfo[playerid][fwid-1][able] = 1;
fwInfo[playerid][fwid-1][obj_id] = -1;
}
}
return 1;
}