destroy object
#1

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.
Reply
#2

I dont follow, what do u mean a killing strak o 10? Do you mean kill score of 10?
Reply
#3

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.
Reply
#4

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;
	}
Reply
#5


Код:
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,
Reply
#6

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
Reply
#7

Код:
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
Reply
#8

Under OnGameMOdeInit

SetTimer("killer", 20000,1);

Yu would need to make a public called Killer, which would destroy the object.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)