SA-MP Forums Archive
Siren Problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Siren Problem (/showthread.php?tid=416579)



Siren Problem - Akcent_Voltaj - 17.02.2013

i type /slon every thing is perfect.puts on the siren.i cant take it off..

PHP код:
if(strcmp(cmd"/slon"true) == 0)
                    {
                    new 
VID2 governcar[2];
                    if(
Siren[VID2] == false)//nooo
                    
{
                        
format(stringsizeof(string), "* %s a pus sirena pe masina."sendername);
                        
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                        new 
govern2 CreateObject(18646,0,0,-1000,0,0,0,100);
                        
AttachObjectToVehicle(govern2,governcar[2],...........); //Object Model: 18646 |
                        
Siren[VID2] = true;
                    }
                    else if(
Siren[VID2] == true)
                    {
                        
format(stringsizeof(string), "* %s a dat jos sirena pe masina."sendername);
                        
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                        
DestroyObject(govern2[VID2]); //old way,any errors?nope
                        
Siren[VID2] = false;
                    }
                    return 
1;
                    } 



Re: Siren Problem - lollie123 - 17.02.2013

Just try:
Look at this
pawn Код:
new govern2 = CreateObject(18646,0,0,-1000,0,0,0,100);
pawn Код:
DestroyObject(govern2);



Re: Siren Problem - Akcent_Voltaj - 17.02.2013

i tried..doesent work..


Re: Siren Problem - Akcent_Voltaj - 17.02.2013

is DestroyObject(govern2); a 0.3x bug??


Re: Siren Problem - IstuntmanI - 17.02.2013

Create govern2 globally, with MAX_PLAYERS:
pawn Код:
new govern2[ MAX_PLAYERS ];
then use
pawn Код:
govern2[ playerid ] = CreateObject( ... );
and
pawn Код:
DestroyObject( govern2[ playerid ] );



Re: Siren Problem - Akcent_Voltaj - 17.02.2013

did you test cmd?


Re: Siren Problem - Akcent_Voltaj - 17.02.2013

Finnalyyy :X il rep you dupa 24 hours )


Re: Siren Problem - Akcent_Voltaj - 18.02.2013

For example. X puts siren on.if Y takes Siren off the siren gets bugged /gon!Please help me

Quote:

if(strcmp(cmd, "/gon", true) == 0)
{
if (PlayerInfo[playerid][pLeader] == 7)
{
new VID3 = governcar[3];
if(Siren[VID3] == false)
{
format(string, sizeof(string), "* %s a pus girofarul pe masina.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
govern3[playerid] = CreateObject(.....);
AttachObjectToVehicle(govern3[playerid],governcar[3],......); //Object Model: 18646 |
Siren[VID3] = true;
}
else if(Siren[VID3] == true)
{
format(string, sizeof(string), "* %s a luat girofarul de pe masina.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
DestroyObject(govern3[playerid]);
Siren[VID3] = false;
}
}
return 1;
}