destroy object -
02manchestera - 28.03.2010
Ok i got most of the code but i dont no how to to put it to gether could you give me a hand thanks.
What the plan is to do is that the minigun is placed then destroyed after say 20 seconds. but they can only place it if they have had a killing strak of 10.
Код:
if (strcmp("/createminigun", cmdtext, true, 14) == 0)
{
new Float:createx, Float:createy, Float:createz, Float:Rotation;
GetPlayerPos(playerid,createx,createy,createz);
GetPlayerFacingAngle(playerid,Rotation);
SaveMinigunDataToLog(CreateMinigun(createx,createy,createz -1,Rotation,10,4,true),"blub");
return 1
;
Код:
DestroyMinigun(minigunid)
Код:
if(spree[killerid] == 10) {
Thankyou for reading and hope you can help.
Re: destroy object -
[LSR]State_Trooper - 28.03.2010
I dont follow, what do u mean a killing strak o 10? Do you mean kill score of 10?
Re: destroy object -
02manchestera - 28.03.2010
What it is on my sevrer if you kill 5 peole a text draw some up say 'jack is on a 5 killing streak' and then 10 15 .......
But i want the command here only useable if you have had a 10 killing streak and you can only place it once, then after 20 seconds it is destroyed.
Hope you understand.
Re: destroy object -
02manchestera - 28.03.2010
I have tried here but it isnt right and it doesnt have the destroy object timer
Код:
if (strcmp("/createminigun", cmdtext, true, 14) == 0)
if(spree[killerid] == 10) {
{
new Float:createx, Float:createy, Float:createz, Float:Rotation;
GetPlayerPos(playerid,createx,createy,createz);
GetPlayerFacingAngle(playerid,Rotation);
SaveMinigunDataToLog(CreateMinigun(createx,createy,createz -1,Rotation,10,4,true),"blub");
{
else
{
SendClientMessage(playerid , " You do not have access to the equipment"):
return 1;
}
Re: destroy object -
[LSR]State_Trooper - 28.03.2010
Код:
if (strcmp("/createminigun", cmdtext, true, 14) == 0)
if (GetPlayerScore(killerid) == 10)
{
new Float:createx, Float:createy, Float:createz, Float:Rotation;
GetPlayerPos(playerid,createx,createy,createz);
GetPlayerFacingAngle(playerid,Rotation);
SaveMinigunDataToLog(CreateMinigun(createx,createy,createz -1,Rotation,10,4,true),"blub");
return 1
;
Код:
DestroyMinigun(minigunid)
Код:
if(spree[killerid] == 10) {
Thankyou for reading and hope you can help.
[/quote]
Try that for score... Use a timer for pickup . Ill keep updating I need ago for abit now though,
Re: destroy object -
[LSR]State_Trooper - 28.03.2010
appologies for double post,
just thaught
try this ( not tested)
new killer[MAX_PLAYERS];
OnGameModeInit
killer = 0;
Then in ur code
if (strcmp("/createminigun", cmdtext, true, 14) == 0)
if (GetPlayerScore(killerid) == 10)
{
killer = 0;
new Float:createx, Float:createy, Float:createz, Float:Rotation;
GetPlayerPos(playerid,createx,createy,createz);
GetPlayerFacingAngle(playerid,Rotation);
SaveMinigunDataToLog(CreateMinigun(createx,createy ,createz -1,Rotation,10,4,true),"blub");
return 1
then something like if killer = 1;
{
SendClientMessage(playerid,COLOR_RED,"Error,You have used this already");
}
Not testedd, Just anexample
Re: destroy object -
02manchestera - 28.03.2010
Код:
if (strcmp("/createminigun", cmdtext, true, 14) == 0)
if(spree[playerid] == 10) {
{
new Float:createx, Float:createy, Float:createz, Float:Rotation;
GetPlayerPos(playerid,createx,createy,createz);
GetPlayerFacingAngle(playerid,Rotation);
SaveMinigunDataToLog(CreateMinigun(createx,createy,createz -1,Rotation,10,4,true),"blub");
}
return 1;
}
This is working now how to i destroy the object now with a 20 second timer
Re: destroy object -
[LSR]State_Trooper - 28.03.2010
Under OnGameMOdeInit
SetTimer("killer", 20000,1);
Yu would need to make a public called Killer, which would destroy the object.