What's the problem?
#1

The errors:
C:\Users\Lenovo\Downloads\SA-MP1\gamemodes\SanJoseRolePlay.pwn(22435) : error 001: expected token: "*then", but found ")"
C:\Users\Lenovo\Downloads\SA-MP1\gamemodes\SanJoseRolePlay.pwn(22435) : error 029: invalid expression, assumed zero

and there is the code:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
new szString[144];
if weaponid = 23);
ApplyPlayerAnimation(playerid, "COLT45", "COLT45_RELOAD", 4.0, 0, 0, 0, 0, 0, 1);
return 1;
}


i want a system when a player shoots the tazer, play a reload animation
Reply
#2

pawn Код:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
new szString[144];
if(weaponid == 23) ApplyPlayerAnimation(playerid, "COLT45", "COLT45_RELOAD", 4.0, 0, 0, 0, 0, 0, 1);
return 1;
}
Why did you create a new string for nothing?
Reply
#3

You cannot terminate an if statement with a semicolon.
You forgot to open a parentheses.
Equal sign for checking is double.

It would have to be either:
pawn Код:
if (weaponid == 23)
    ApplyPlayerAnimation(playerid, "COLT45", "COLT45_RELOAD", 4.0, 0, 0, 0, 0, 0, 1);
for 1 function call or a group (for more):
pawn Код:
if (weaponid == 23)
{
    ApplyPlayerAnimation(playerid, "COLT45", "COLT45_RELOAD", 4.0, 0, 0, 0, 0, 0, 1);
}
Reply
#4

Ohh, thanks Konstantinos
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)