[SOLVED]I have an alcohol problem .. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [SOLVED]I have an alcohol problem .. (
/showthread.php?tid=99731)
[SOLVED]I have an alcohol problem .. -
ded - 30.09.2009
Okay so .. I have made a command .. to get a player drunk, kinda like to test out how to do stuff.
The command:
pawn Код:
dcmd_beer(playerid, params[])
{
#pragma unused params
new string[128];
ImDrinking[playerid] = 1; // This bit sets the timer to recognise me as drinking.
format(string,sizeof(string),"You now have a bottle of beer, break a leg!");
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DRINK_BEER);
return SendClientMessage(playerid, Green, string);
}
.. and the timer .. to complement the command .. is
supposed to set the player with the drunk animation after drinking a little bit.
pawn Код:
Drunktimer = SetTimer("IrDrunk", 1000, 1);
pawn Код:
public irdrunk()
{
for(new i; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && ImDrinking[i] == 1 && GetPlayerDrunkLevel(i) >= 4000)
{
ApplyAnimation(i,"PED","WALK_DRUNK",4.1,1,1,1,1,1);
}
/* if(IsPlayerConnected(i) && ImDrinking[i] && GetPlayerDrunkLevel(i) >= 20000)
{
SetPlayerHealth(i, 0);
} */
}
return 1;
}
.. but it doesn't work ... any idea's why
Thanks in advance.
EDIT:
Lmao .. never mind I solved it .. I should really pay attention a bit more.
The error was down to a mistake in letter-case the timer was calling "IrDrunk" when the function was called "irdrunk".
Solved .. how embarrassing.
Re: [SOLVED]I have an alcohol problem .. -
TMasters - 30.09.2009
wrong section, you should post this under 0.3 section
Re: [SOLVED]I have an alcohol problem .. -
ded - 30.09.2009
It doesn't really matter as it's solved