public OnPlayerConnect(playerid)
{
countpos[playerid] = 0;
return 1;
}
public Counter()
{
for(new i; i < GetMaxPlayers(); i++)
{
if(IsPlayerConnected(i) && countpos[i] != 0)
{
countpos[i]++;
if(countpos[i] == 4)
{
countpos[i] = 0;
DestroyObject(Flame[i][0]);
DestroyObject(Flame[i][1]);
}
}
}
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (PRESSED(KEY_FIRE))
{
new vehid = GetPlayerVehicleID(playerid);
if(GetVehicleModel(vehid) == 522)
{
new Float:Velocity[3];
GetVehicleVelocity(vehid, Velocity[0], Velocity[1], Velocity[2]);
if(Velocity[0] <1.3 && Velocity[1] < 1.3 && Velocity[0] > -1.3 && Velocity[1] > -1.3)
{
SetVehicleVelocity(vehid, Velocity[0]*2, Velocity[1]*2, 0.0);
if(countpos[playerid] == 0)
{
Flame[playerid][0] = CreateObject(18693, 0.0, 0.0, 0.0, 0.0, 0, 0, 0);
Flame[playerid][1] = CreateObject(18693, 0.0, 0.0, 0.0, 0.0, 0, 0, 0);
AttachObjectToVehicle(Flame[playerid][0], vehid, 0.194999, 0.439999, 0.044999, 86.429962, 0.000000, 0.000000);
AttachObjectToVehicle(Flame[playerid][1], vehid, -0.204999, 0.439999, 0.044999, 86.429962, 0.000000, 0.000000);
countpos[playerid] = 1;
}
}
}
}
}
public OnPlayerDisconnect(playerid, reason)
{
if(countpos[playerid] != 0)
{
countpos[playerid] = 0;
DestroyObject(Flame[playerid][0]);
DestroyObject(Flame[playerid][1]);
}
return 1;
}
C:\Users\Farius\Desktop\Comandos.pwn(65) : error 029: invalid expression, assumed zero C:\Users\Farius\Desktop\Comandos.pwn(65) : warning 215: expression has no effect C:\Users\Farius\Desktop\Comandos.pwn(65) : error 001: expected token: ";", but found "]" C:\Users\Farius\Desktop\Comandos.pwn(65) : error 029: invalid expression, assumed zero C:\Users\Farius\Desktop\Comandos.pwn(65) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors. |
public OnPlayerConnect(playerid) { countpos[playerid] = 0; return 1; } |
#define countpos |
new countpos[MAX_PLAYERS];
//new Flame[MAX_PLAYERS][2];
/* ================================================== |[FS] By Omegaki ================================================== */ #include <a_samp> #define PRESSED(%0) \ (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0))) new countpos[MAX_PLAYERS]; new Flame[MAX_PLAYERS][2]; forward Counter(); public OnFilterScriptInit() { SetTimer("Counter",1000,1); return 1; } public OnPlayerConnect(playerid) { countpos[playerid] = 0; return 1; } public Counter() { for(new i; i < GetMaxPlayers(); i++) { if(IsPlayerConnected(i) && countpos[i] != 0) { countpos[i]++; if(countpos[i] == 4) { countpos[i] = 0; DestroyObject(Flame[i][0]); DestroyObject(Flame[i][1]); } } } return 1; } public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { if (PRESSED(KEY_FIRE)) { new vehid = GetPlayerVehicleID(playerid); if(GetVehicleModel(vehid) == 522) { new Float:Velocity[3]; GetVehicleVelocity(vehid, Velocity[0], Velocity[1], Velocity[2]); if(Velocity[0] <1.3 && Velocity[1] < 1.3 && Velocity[0] > -1.3 && Velocity[1] > -1.3) { SetVehicleVelocity(vehid, Velocity[0]*2, Velocity[1]*2, 0.0); if(countpos[playerid] == 0) { Flame[playerid][0] = CreateObject(18693, 0.0, 0.0, 0.0, 0.0, 0, 0, 0); Flame[playerid][1] = CreateObject(18693, 0.0, 0.0, 0.0, 0.0, 0, 0, 0); AttachObjectToVehicle(Flame[playerid][0], vehid, 0.194999, 0.439999, 0.044999, 86.429962, 0.000000, 0.000000); AttachObjectToVehicle(Flame[playerid][1], vehid, -0.204999, 0.439999, 0.044999, 86.429962, 0.000000, 0.000000); countpos[playerid] = 1; } } } } } public OnPlayerDisconnect(playerid, reason) { if(countpos[playerid] != 0) { countpos[playerid] = 0; DestroyObject(Flame[playerid][0]); DestroyObject(Flame[playerid][1]); } return 1; } |