If command is enabled, effects will be done if a player punches
#1

Hi there.

I'm basically looking for a example that'll show me how to do something similar to this.

If a player types a command, for example, /enablesparks, and then clicks (punches), a red or white glow (preferably selectable) will erupt from the player's fist and will go on into the direction of the punch.

http://forum.sa-mp.com/showthread.ph...light=firework (3:20 on the video, the red and white glows)

Is this possible, and could someone give me a example?
Reply
#2

Lets start, use a variable for the command
pawn Код:
new Fire[MAX_PLAYERS];//using the variable to delet the player who used the command
Now the command
[PAWN]
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/enablesparks", cmdtext, true, 10) == 0)
{
Fire[playerid]=1;//now the punch will glow.
return 1;
}
return 0;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == KEY_FIRE && Fire[playerid] ==1)
{
//now you can make the glow here using what ever you want.
}
return 1;
}
Reply
#3

Thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)