24.01.2015, 08:51
Hi, i'm a little new in this world of pawno, i need help with a command to make when i write /pgun , i need to be crouch if not a text warns me " you need to be crouch to pick the gun " , i know is too much to ask but i need help please. i put the code here thanks.
pawn Код:
if(strcmp(cmdtext, "/pickupgun", true) == 0
|| strcmp(cmdtext, "/pgun", true) == 0)
{
if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return 1;
new f = Mnew a = 0; a < MAX_OBJ; a++)
{AX_OBJ+1;
for(
if(IsPlayerInRangeOfPoint(playerid, 5.0, dGunData[a][ObjPos][0], dGunData[a][ObjPos][1], dGunData[a][ObjPos][2]))
{
f = a;
break;
}
}
if(f > MAX_OBJ) return SendClientMessage(playerid, 0x33AA3300, "No estas cerca del arma que quieres agarrar!");
DestroyObject(dGunData[f][ObjID]);
GivePlayerWeapon(playerid, dGunData[f][ObjData][0], dGunData[f][ObjData][1]);
dGunData[f][ObjPos][0] = 0.0;
dGunData[f][ObjPos][1] = 0.0;
dGunData[f][ObjPos][2] = 0.0;
dGunData[f][ObjID] = -1;
//dGunData[f][ObjData][0] = 0;
dGunData[f][ObjData][1] = 0;
new buffer[50];
format(buffer, sizeof(buffer), "* Recogiste un arma del suelo: %s", GunNames[dGunData[f][ObjData][0]]);
SendClientMessage(playerid, 0x33AA3300, buffer);
return 1;
}
return 0;
}