FrOsTy14 4 Odesláno: 18. Únor, 2015 Share Odesláno: 18. Únor, 2015 Zdravím potřebuju, aby mi to smazalo objekt, ale jen to napíše že se vypl ale nesmaže se. code { new majak = CreateObject( 19292,0,0,0,0,0,0,80 ); if(majakzapnout) { majakzapnout = false; AttachObjectToVehicle( majak, GetPlayerVehicleID(playerid), 0.000000, 1.200000, 0.100000, 0.000000, 0.000000, 0.000000 ); new string[128]; new Hname[128]; GetPlayerName(playerid,Hname,128); format(string,128,"*%s zapl majáček!",Hname); ProxDetector(10.0, playerid, string, -1); } else { majakzapnout = true; DestroyObject(majak); new string[128]; new Hname[128]; GetPlayerName(playerid,Hname,128); format(string,128,"*%s vypl majáček!",Hname); ProxDetector(10.0, playerid, string, -1); } } Link to comment Share on other sites More sharing options...
0 ĐaVe 33 Odesláno: 18. Únor, 2015 Share Odesláno: 18. Únor, 2015 Zdravím potřebuju, aby mi to smazalo objekt, ale jen to napíše že se vypl ale nesmaže se. code { new majak = CreateObject( 19292,0,0,0,0,0,0,80 ); if(majakzapnout) { majakzapnout = false; AttachObjectToVehicle( majak, GetPlayerVehicleID(playerid), 0.000000, 1.200000, 0.100000, 0.000000, 0.000000, 0.000000 ); new string[128]; new Hname[128]; GetPlayerName(playerid,Hname,128); format(string,128,"*%s zapl majáček!",Hname); ProxDetector(10.0, playerid, string, -1); } else { majakzapnout = true; DestroyObject(majak); new string[128]; new Hname[128]; GetPlayerName(playerid,Hname,128); format(string,128,"*%s vypl majáček!",Hname); ProxDetector(10.0, playerid, string, -1); } } no ono taky zalezi pokud to testujes sam nebo s nekym... protoze promennou majak mas jen jednu tudiz jen pro posledniho hrace co majak vytvori... vyuzij: new majak[MAX_PLAYERS]; potom majak[playerid] = CreateObject(... Link to comment Share on other sites More sharing options...
0 Matess 36 Odesláno: 18. Únor, 2015 Share Odesláno: 18. Únor, 2015 Spíš pokud je tohle tvůj příkaz, tak se nediv že se nesmaže. Ty ho prvně vytvoříš a pak attachneš, ale když ten příkaz dáš znovu tak ho vytvoříš znova a deletneš pouze ten novej. Takže takto: new majak; if(majakzapnout) { majak = CreateObject( 19292,0,0,0,0,0,0,80 ); majakzapnout = false; AttachObjectToVehicle( majak, GetPlayerVehicleID(playerid), 0.000000, 1.200000, 0.100000, 0.000000, 0.000000, 0.000000 ); Link to comment Share on other sites More sharing options...
0 FrOsTy14 4 Odesláno: 18. Únor, 2015 Author Share Odesláno: 18. Únor, 2015 Pořád svítí { new majak; if(majakzapnout[playerid]) { majakzapnout[playerid] = false; majak = CreateObject( 19292,0,0,0,0,0,0,80 ); AttachObjectToVehicle( majak, GetPlayerVehicleID(playerid), 0.000000, 1.200000, 0.100000, 0.000000, 0.000000, 0.000000 ); new string[128]; new Hname[128]; GetPlayerName(playerid,Hname,128); format(string,128,"*%s zapl majáček!",Hname); ProxDetector(10.0, playerid, string, -1); } else { majakzapnout[playerid] = true; DestroyObject(majak); new string[128]; new Hname[128]; GetPlayerName(playerid,Hname,128); format(string,128,"*%s vypl majáček!",Hname); ProxDetector(10.0, playerid, string, -1); } } Link to comment Share on other sites More sharing options...
Dotaz
FrOsTy14 4
Zdravím potřebuju, aby mi to smazalo objekt, ale jen to napíše že se vypl ale nesmaže se.
code
Link to comment
Share on other sites
3 odpovědí na tuto otázku
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now