08.11.2013, 14:54
Hello i am getting this error and i have no clue on how to solve it.
I want to get the seconds form the c4 timer to send the client a message each second of the countdown like
code:
pawn Код:
(59) : error 035: argument type mismatch (argument 1)
pawn Код:
if(gettime(C4DELAY[playerid] == 5))
{
SendClientMessage(playerid, -1, "5 secons untill detonation!");
}
if(gettime(C4DELAY[playerid] == 4))
{
SendClientMessage(playerid, -1, "4 secons untill detonation!");
}
//ETC....
pawn Код:
new C4DELAY[MAX_PLAYERS];
forward C4_DELAY(playerid);
public C4_DELAY(playerid)
{
CreateExplosion(BombaX[playerid],BombaY[playerid],BombaZ[playerid], 2, 20.0);
DestroyPlayerObject(playerid,bomb);
KillTimer(C4DELAY[playerid]);
return 1;
}
CMD:plantc4(playerid, params[])
{
GetPlayerPos(playerid, BombaX[playerid], BombaY[playerid], BombaZ[playerid]);
bomb = CreatePlayerObject(playerid, 1252, BombaX[playerid]-0.5,BombaY[playerid],BombaZ[playerid]-0.5,0,-1,-1,-1);
return 1;
}
CMD:explodec4(playerid, params[])
{
if(IsValidPlayerObject(playerid,bomb))
{
C4DELAY[playerid] = SetTimer("C4_DELAY", 5000, false);
SendClientMessage(playerid, -1, "5 Seconds untill detonation!");
if(gettime(C4DELAY[playerid] == 5)) //LINE 59 <----------------------
{
SendClientMessage(playerid, -1, "5 secons untill detonation!");
}
}
else
{
SendClientMessage(playerid, -1, "You did not place any C4!");
}
return 1;
}