SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 15/08/2014, 09:00 PM   #1
kamiliuxliuxliux
Huge Clucker
 
kamiliuxliuxliux's Avatar
 
Join Date: Nov 2013
Location: Lithuania
Posts: 244
Reputation: 17
Default Firework system

Hello, I've created new firework system and when player types /fw a timer starts... Everything is below.
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;
}
So is there any ways to change the value of public parameters?
__________________
+rep if helped!

Last edited by kamiliuxliuxliux; 15/08/2014 at 10:24 PM.
kamiliuxliuxliux is offline   Reply With Quote
Old 15/08/2014, 10:25 PM   #2
kamiliuxliuxliux
Huge Clucker
 
kamiliuxliuxliux's Avatar
 
Join Date: Nov 2013
Location: Lithuania
Posts: 244
Reputation: 17
Default Re: Firework system

Anyone?
__________________
+rep if helped!
kamiliuxliuxliux is offline   Reply With Quote
Old 15/08/2014, 10:44 PM   #3
ThePhenix
Gangsta
 
ThePhenix's Avatar
 
Join Date: May 2012
Posts: 801
Reputation: 157
Default Re: Firework system

What do you exactly mean by changing the value of public functions?
You can make an optional parameter by designing a default value to a certain parameter.
ThePhenix is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Firework system biker122 Scripting Help 2 03/05/2014 02:41 PM
[Tutorial] Creating Firework System HolyScripter Tutorials 10 08/11/2013 11:10 PM
[FilterScript] [WIP] Firework System PhantomZ Filterscripts 4 18/07/2013 10:07 AM


All times are GMT. The time now is 10:11 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.