29.10.2009, 19:23
Well, i seem to having a hell of a time with coding today.. I cannot get it to actually get their current weapon, and get it to work..
I have this:
Which works fine, but if I add another perimeter...
It doesn't seem to work, a bit of help, please?
I have this:
pawn Код:
else if (newkeys & KEY_FIRE)
{
if(bombplaced[playerid] == 1)
{
new plname[MAX_PLAYER_NAME];
new year, month,day;
getdate(year, month, day);
GetPlayerName(playerid, plname, sizeof(plname));
CreateExplosion(Float:BombX[playerid], Float:BombY[playerid], Float:BombZ[playerid], 6, 10.0);
CreateExplosion(Float:BombX[playerid], Float:BombY[playerid], Float:BombZ[playerid], 6, 10.0);
CreateExplosion(Float:BombX[playerid], Float:BombY[playerid], Float:BombZ[playerid], 6, 10.0);
CreateExplosion(Float:BombX[playerid], Float:BombY[playerid], Float:BombZ[playerid], 6, 10.0);
SendClientMessage(playerid, red, "Your bomb has been detonated.");
bombplaced[playerid] = 0;
DestroyObject(bomb[playerid]);
}
}
pawn Код:
else if (newkeys & KEY_FIRE)
{
if(bombplaced[playerid] == 1)
{
if(GetPlayerWeapon(playerid) == 40)
{
new plname[MAX_PLAYER_NAME];
new year, month,day;
getdate(year, month, day);
GetPlayerName(playerid, plname, sizeof(plname));
CreateExplosion(Float:BombX[playerid], Float:BombY[playerid], Float:BombZ[playerid], 6, 10.0);
CreateExplosion(Float:BombX[playerid], Float:BombY[playerid], Float:BombZ[playerid], 6, 10.0);
CreateExplosion(Float:BombX[playerid], Float:BombY[playerid], Float:BombZ[playerid], 6, 10.0);
CreateExplosion(Float:BombX[playerid], Float:BombY[playerid], Float:BombZ[playerid], 6, 10.0);
SendClientMessage(playerid, red, "Your bomb has been detonated.");
bombplaced[playerid] = 0;
DestroyObject(bomb[playerid]);
}
}
}