[HELP]Cigarette -
darkdrago - 25.01.2011
PlayerActionMessage(playerid,15.0,"fа un tiro con la sua sigaretta");
PlayerActionMessage(playerid,15.0,"finisce la sigaretta e la butta per terra");
Don't work on KEY_FIRE and KEY_SECONDARY_ATTACK
Please help
Код:
new fumare[MAX_PLAYERS];
Код:
if(strcmp(cmd, "/fuma", true) == 0)
{
if(accendino[playerid] == 1)
{
if(sigarette[playerid] > 0)
{
if(fumare[playerid] == 0)
{
new Float:health;
GetPlayerHealth(playerid,health);
SendClientMessage(playerid,COLOR_INFO,"[INFO:]Premi il Tasto Pugno per fare un tiro!");
ApplyAnimation(playerid,"SMOKING","M_smk_in",4.1,0,1,1,1,7000,1);
SmokeAnimation(playerid);
fumare[playerid] = 1;
sigarette[playerid] --;
SetPlayerHealth(playerid, health-5);
PlayerActionMessage(playerid,15.0,"fuma una sigaretta e tossisce un po.");
}
else
{
SendClientMessage(playerid, COLOR_RED, "Non hai sigarette");
}
}
}
return 1;
}
Код:
new fumare[MAX_PLAYERS];
if (newkeys == KEY_FIRE)
{
if(fumare[playerid] == 1)
{
PlayerActionMessage(playerid,15.0,"fа un tiro con la sua sigaretta");
}
}
if (newkeys == KEY_SECONDARY_ATTACK)
{
if(fumare[playerid] == 1)
{
PlayerActionMessage(playerid,15.0,"finisce la sigaretta e la butta per terra");
fumare[playerid] = 0;
}
}
Код:
forward SmokeAnimation(playerid);
public SmokeAnimation(playerid)
{
ClearAnimations(playerid);
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_SMOKE_CIGGY);
ApplyAnimation(playerid,"SMOKING","M_smk_in",4.1,0,1,1,1,7000,1);
fumare[playerid] = 1;
SetTimerEx("SmokeTimer", 20000, false, "i", playerid);
return 1;
}
forward SmokeTimer(playerid);
public SmokeTimer(playerid)
{
ApplyAnimation(playerid,"SMOKING","M_smk_out",4.1,0,1,1,1,7000,1);
new Float:x,Float:y,Float:z;
fumare[playerid] = 0;
PlayerActionMessage(playerid, 15.0, "finisce la sigaretta e la butta per terra.");
GetPlayerPos(playerid,x,y,z);
CreateObject(3044, x,y,z, 0.0, 0.0, 96.0);
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_NONE);
TogglePlayerControllable(playerid,1);
return 1;
}
Please help me, you are very talented and experienced ...
Sorry for my bad english, I'm italian lol
Re: [HELP]Cigarette -
HyperZ - 25.01.2011
pawn Код:
if (newkeys & KEY_FIRE)
{
if(fumare[playerid] == 1)
{
PlayerActionMessage(playerid,15.0,"fа un tiro con la sua sigaretta");
}
}
if (newkeys & KEY_SECONDARY_ATTACK)
{
if(fumare[playerid] == 1)
{
PlayerActionMessage(playerid,15.0,"finisce la sigaretta e la butta per terra");
fumare[playerid] = 0;
}
}
Re: [HELP]Cigarette -
darkdrago - 25.01.2011
Код:
D:\DOCUME~1\Gi\DOCUME~1\SAMPSE~1\GAMEMO~1\SAGCBR~1.PWN(23924) : error 001: expected token: ")", but found "if"
D:\DOCUME~1\Gi\DOCUME~1\SAMPSE~1\GAMEMO~1\SAGCBR~1.PWN(23933) : error 029: invalid expression, assumed zero
Re: [HELP]Cigarette -
HyperZ - 25.01.2011
Check again:
pawn Код:
if (newkeys & KEY_FIRE)
{
if(fumare[playerid] == 1)
{
PlayerActionMessage(playerid,15.0,"fа un tiro con la sua sigaretta");
}
}
if (newkeys & KEY_SECONDARY_ATTACK)
{
if(fumare[playerid] == 1)
{
PlayerActionMessage(playerid,15.0,"finisce la sigaretta e la butta per terra");
fumare[playerid] = 0;
}
}
Re: [HELP]Cigarette -
darkdrago - 25.01.2011
however, gave no mistake, wrong and wrong again in game
not work PlayerActionMessage...