C:\Brasil Auto Estrada\filterscripts\tapetelets.pwn(102) : error 076: syntax error in the expression, or invalid function call
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Error.
KillTimer(Pneu);
#define FILTERSCRIPT
#include <a_samp>
#define TireDano(%1,%2,%3,%4) %1 | (%2 << 1) | (%3 << 2) | (%4 << 3)
forward Pneu(playerid);
new
Tapete,
Angle,
Float:xx,
Float:yy,
Float:zz;
forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
new connect_timer[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
print("Iniciando Timer...");
connect_timer[playerid] = SetTimerEx("WelcomeTimer", 5000, true, "i", playerid);
return 1;
}
public OnPlayerDisconnect(playerid)
{
KillTimer(Pneu(playerid));
return 1;
}
public OnGameModeInit()
{
if(GetMaxPlayers() > MAX_PLAYERS)
{
SendRconCommand("Servidor Fechado - Volte Depois!");
SendRconCommand("password 123321456654");
printf("[ERROR]: 'maxplayers' (%i) exceeds MAX_PLAYERS (%i). Please fix this.", GetMaxPlayers(), MAX_PLAYERS);
}
}
public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
if(IsPlayerConnected(playerid))
{
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
tempposx = (oldposx -x);
tempposy = (oldposy -y);
tempposz = (oldposz -z);
if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
return 1;
}
}
return 0;
}
public OnFilterScriptInit()
{
SetTimer("Pneu",120,1);
return 1;
}
public Pneu(playerid)
{
new Dano[4];
if (IsPlayerInAnyVehicle(playerid))
{
if (PlayerToPoint(5.0, playerid,xx,yy,zz))
{
GetVehicleDamageStatus(GetPlayerVehicleID(playerid), Dano[0], Dano[1], Dano[2], Dano[3]);
UpdateVehicleDamageStatus(GetPlayerVehicleID(playerid), Dano[0], Dano[1], Dano[2], TireDano(1, 1, 1, 1));
}
}
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/tapete", cmdtext, true, 10) == 0)
{
GetPlayerPos(playerid,xx,yy,zz);
Tapete = CreateObject(2899, xx, yy, zz, 0, 0, Angle);
return 1;
}
if (strcmp("/deletartapete", cmdtext, true, 10) == 0)
{
DestroyObject(Tapete);
KillTimer(Pneu);
return 1;
}
return 0;
}
KillTimer(Pneu);
KillTimer(Pneu(playerid));
#define FILTERSCRIPT #include <a_samp> #define TireDano(%1,%2,%3,%4) %1 | (%2 << 1) | (%3 << 2) | (%4 << 3) forward Pneu(playerid); new Tapete, Angle, Float:xx, Float:yy, Float:zz; new PlayerTap[MAX_PLAYERS] = 0; forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z); new connect_timer[MAX_PLAYERS]; public OnPlayerConnect(playerid) { print("Iniciando Timer..."); connect_timer[playerid] = SetTimerEx("WelcomeTimer", 5000, true, "i", playerid); return 1; } public OnPlayerDisconnect(playerid) { if(PlayerTap[playerid] == 1) { DestroyObject(Tapete); } KillTimer(Pneu(playerid)); PlayerTap[playerid] = 0; return 1; } public OnGameModeInit() { if(GetMaxPlayers() > MAX_PLAYERS) { SendRconCommand("Servidor Fechado - Volte Depois!"); SendRconCommand("password 123321456654"); printf("[ERROR]: 'maxplayers' (%i) exceeds MAX_PLAYERS (%i). Please fix this.", GetMaxPlayers(), MAX_PLAYERS); } } public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z) { if(IsPlayerConnected(playerid)) { new Float:oldposx, Float:oldposy, Float:oldposz; new Float:tempposx, Float:tempposy, Float:tempposz; GetPlayerPos(playerid, oldposx, oldposy, oldposz); tempposx = (oldposx -x); tempposy = (oldposy -y); tempposz = (oldposz -z); if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi))) { return 1; } } return 0; } public OnFilterScriptInit() { SetTimer("Pneu",120,1); return 1; } public Pneu(playerid) { new Dano[4]; if (IsPlayerInAnyVehicle(playerid)) { if (PlayerToPoint(5.0, playerid,xx,yy,zz)) { GetVehicleDamageStatus(GetPlayerVehicleID(playerid), Dano[0], Dano[1], Dano[2], Dano[3]); UpdateVehicleDamageStatus(GetPlayerVehicleID(playerid), Dano[0], Dano[1], Dano[2], TireDano(1, 1, 1, 1)); } } } public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/tapete", cmdtext, true, 10) == 0) { if(PlayerTap[playerid] == 0) { GetPlayerPos(playerid,xx,yy,zz); Tapete = CreateObject(2899, xx, yy, zz-0.9, 0, 0, Angle-90); PlayerTap[playerid] = 1; return 1; } else { SendClientMessage(playerid, -1, "Vocк jб colocou um Tapete De Pregos."); return 1; } } if (strcmp("/deletartapete", cmdtext, true, 10) == 0) { if(PlayerTap[playerid] == 1) { DestroyObject(Tapete); KillTimer(Pneu(playerid)); PlayerTap[playerid] = 0; return 1; } else { SendClientMessage(playerid, -1, "Vocк nгo colocou um Tapete De Pregos."); return 1; } } return 0; }
new nTimerid; //Topo
public OnFilterScriptInit()
{
nTimerid = SetTimer("Pneu",120,1);
return 1;
}
//deletar tapete
KillTimer(nTimerid);
Pegou sу que deu um problema ..,. usa-se o /removertapete o objeto do tapete sai mais ainda fica sendo furado o pneu de quem passar por la ... oque ta errado ??
|
Certifique-se de ter armazenado o ID do temporizador corretamente na variбvel, e tambйm que estбs a passar o parвmetro correto no KillTimer, que deve ser a variбvel que tem armazenada o ID do temporizador.
Vocк definitivamente nem mesmo se esforзou para tentar entender a minha mensagem acima, estгo nгo estб apto a ser ajudado. |