Help Timer
#1

Quote:
Originally Posted by TMasters.ProRP
The code:
pawn Код:
//On top of my GM
forward strike(playerid,Float:cX,Float:cY,Float:cZ);
pawn Код:
//The command
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmdtext, "/airstrike", true)==0)
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
SetTimerEx("strike", 7000, false, "ifff", playerid,X,Y,Z);
SendClientMessage(playerid, 0xFFFFFFAA, "Airstrike on your position in 7 seconds!");
return 1;
}
return 0;
}
pawn Код:
// And this
public strike(playerid,cX,cY,cZ)
{
    CreateExplosion(cX, cY, cZ, 7, 100);
    CreateExplosion(cX+5, cY, cZ, 7, 100);
    CreateExplosion(cX, cY+5, cZ, 7, 100);
    CreateExplosion(cX-5, cY, cZ, 7, 100);
    CreateExplosion(cX, cY-5, cZ, 7, 100);
    CreateExplosion(cX+10, cY, cZ, 7, 100);
    CreateExplosion(cX, cY+10, cZ, 7, 100);
}
Something like that should work

didnt test it but thats the thing,

minor error reports could be fixed if you know how to script, i didnt write it carefully
Hi all!

I want to make a command /aistrike like that ^
|
but it doesn't work, i get one error of it
and some warnings but i know how to remove those warnings

error:
Код:
C:\Documents and Settings\Luc\Bureaublad\Pawno\gamemodes\test.pwn(60) : warning 217: loose indentation
C:\Documents and Settings\Luc\Bureaublad\Pawno\gamemodes\test.pwn(236) : warning 217: loose indentation
C:\Documents and Settings\Luc\Bureaublad\Pawno\gamemodes\test.pwn(412) : warning 217: loose indentation
C:\Documents and Settings\Luc\Bureaublad\Pawno\gamemodes\test.pwn(413) : warning 217: loose indentation
C:\Documents and Settings\Luc\Bureaublad\Pawno\gamemodes\test.pwn(490) : warning 217: loose indentation
C:\Documents and Settings\Luc\Bureaublad\Pawno\gamemodes\test.pwn(657) : error 025: function heading differs from prototype

Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
line 657: public strike(playerid,cX,cY,cZ)

666: }
657: public strike(playerid,cX,cY,cZ)
script:
on top:
Код:
#include <a_samp>

forward strike(playerid,Float:cX,Float:cY,Float:cZ);
#define KEY_ACTION				(1)
#define KEY_CROUCH				(2)
#define KEY_FIRE				(4)
#define KEY_SPRINT				(8)
#define KEY_SECONDARY_ATTACK	(16)
#define KEY_JUMP				(32)
#define KEY_LOOK_RIGHT			(64)
#define KEY_HANDBRAKE			(128)
#define KEY_LOOK_LEFT			(256)
#define KEY_SUBMISSION			(512)
#define KEY_LOOK_BEHIND			(512)
#define KEY_WALK				(1024)
#define KEY_ANALOG_UP			(2048)
#define KEY_ANALOG_DOWN			(4096)
#define KEY_ANALOG_RIGHT		(16384)
#define KEY_ANALOG_LEFT			(8192)
#define CS-DM 2003
new DMZone[MAX_PLAYERS];
OnPlayerCommandText:
Код:
	if (strcmp(cmdtext, "/airstrike", true)==0)
	{
	new Float:X, Float:Y, Float:Z;
	GetPlayerPos(playerid, X, Y, Z);
	SetTimerEx("strike", 7000, false, "ifff", playerid,X,Y,Z);
	SendClientMessage(playerid, 0xFFFFFFAA, "Airstrike on your position in 7 seconds!");
	return 1;
	}
under OnPlayerClickPlayer

Код:
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
	return 1;
}
public strike(playerid,cX,cY,cZ)//THIS IS WRONG LINE SRRY 
{
	CreateExplosion(cX, cY, cZ, 7, 100);
	CreateExplosion(cX+5, cY, cZ, 7, 100);
	CreateExplosion(cX, cY+5, cZ, 7, 100);
	CreateExplosion(cX-5, cY, cZ, 7, 100);
	CreateExplosion(cX, cY-5, cZ, 7, 100);
	CreateExplosion(cX+10, cY, cZ, 7, 100);
	CreateExplosion(cX, cY+10, cZ, 7, 100);
} //THIS IS THE LAST LINE
Can some one tell me what is wrong?

Ty Alot

-luckie12
Reply
#2

so
Код:
new Float:cX, Float:cY, Float:cZ;
?

EDIT: Got it It compiles fine!
THANX!
Код:
public strike(playerid,Float:cX, Float:cY, Float:cZ)//THIS IS WRONG LINE SRRY
{
	CreateExplosion(cX, cY, cZ, 7, 100);
	CreateExplosion(cX+5, cY, cZ, 7, 100);
	CreateExplosion(cX, cY+5, cZ, 7, 100);
	CreateExplosion(cX-5, cY, cZ, 7, 100);
	CreateExplosion(cX, cY-5, cZ, 7, 100);
	CreateExplosion(cX+10, cY, cZ, 7, 100);
	CreateExplosion(cX, cY+10, cZ, 7, 100);
} //THIS IS THE LAST LINE
Reply
#3

oh and other question
how can i make only if they have a killing spree (5 kills in a row :P)
they can only use /airstrike ?

ty

-luckie12
Reply
#4

EDIT: i changed
new pKillStreak[PLAYERS];//'PLAYERS' is your player slot amount NOT 500
TO
new pKillStreak[5];//'PLAYERS' is your player slot amount NOT 500

Now it compiles fine xD

but what you mean with
//'PLAYERS' is your player slot amount NOT 500
i have a slot of 50 players
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)