public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { for(new i=0; i<MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { new key, updown, leftright; GetPlayerKeys(i, key, updown, leftright); printf("%d",key); if(key == 140) { if(GetVehicleModel(GetPlayerVehicleID(i)) == 476) { new bombaid; new Float:X,Float:Y,Float:Z,Float:a; GetPlayerPos(i,X,Y,Z); SetPlayerFacingAngle(i,a); bombaid = CreateObject(354,X,Y,Z,0,0,a); new ddb = 10; MoveObject(bombaid,X,Y,Z-ddb,1); new ddb2=ddb*1000; SetTimerEx("explodirBomba",ddb2,false,"dfff",bombaid); } } } } } public explodirBomba(bombaid2) { new Float:X,Float:Y,Float:Z; GetObjectPos(bombaid2,X,Y,Z); CreateExplosion(X,Y,Z, 6, 20.0); CreateExplosion(X+1,Y-1,Z, 6, 20.0); CreateExplosion(X-1,Y+1,Z, 6, 20.0); CreateExplosion(X+1,Y+1,Z, 6, 20.0); CreateExplosion(X-1,Y-1,Z, 6, 20.0); DestroyObject(bombaid2); return 1; }
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
new key, updown, leftright;
GetPlayerKeys(i, key, updown, leftright);
printf("%d",key);
if(key == 140)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 476)
{
new bombaid;
new Float:X,Float:Y,Float:Z,Float:a;
GetPlayerPos(playerid,X,Y,Z);
SetPlayerFacingAngle(playerid,a);
bombaid = CreateObject(354,X,Y,Z,0,0,a);
new ddb = 10;
MoveObject(bombaid,X,Y,Z-ddb,1);
new ddb2=ddb*1000;
SetTimerEx("explodirBomba",ddb2,false,"dfff",bombaid);
}
}
}
C:\Users\Gonзalo.utilizador-PC\Desktop\SAMP - TPD\gamemodes\ENBWW.pwn(26) : error 029: invalid expression, assumed zero C:\Users\Gonзalo.utilizador-PC\Desktop\SAMP - TPD\gamemodes\ENBWW.pwn(26) : error 008: must be a constant expression; assumed zero C:\Users\Gonзalo.utilizador-PC\Desktop\SAMP - TPD\gamemodes\ENBWW.pwn(252) : error 017: undefined symbol "i" C:\Users\Gonзalo.utilizador-PC\Desktop\SAMP - TPD\gamemodes\ENBWW.pwn(271) : error 054: unmatched closing brace ("}") C:\Users\Gonзalo.utilizador-PC\Desktop\SAMP - TPD\gamemodes\ENBWW.pwn(113) : warning 204: symbol is assigned a value that is never used: "Aliado" C:\Users\Gonзalo.utilizador-PC\Desktop\SAMP - TPD\gamemodes\ENBWW.pwn(114) : warning 204: symbol is assigned a value that is never used: "Nazista" C:\Users\Gonзalo.utilizador-PC\Desktop\SAMP - TPD\gamemodes\ENBWW.pwn(114 -- 303) : warning 203: symbol is never used: "ret_memcpy" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
new key, updown, leftright;
GetPlayerKeys(playerid, key, updown, leftright);
printf("%d",key);
if(key == 140)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 476)
{
new bombaid;
new Float:X,Float:Y,Float:Z,Float:a;
GetPlayerPos(playerid,X,Y,Z);
SetPlayerFacingAngle(playerid,a);
bombaid = CreateObject(354,X,Y,Z,0,0,a);
new ddb = 10;
MoveObject(bombaid,X,Y,Z-ddb,1);
new ddb2=ddb*1000;
SetTimerEx("explodirBomba",ddb2,false,"dfff",bombaid);
}
}
}
if(strcmp(cmd, "/BombaR", true) == 0)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 476)
{
new bombaid;
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid,X,Y,Z);
bombaid = CreateObject(354,X,Y,Z,0,0,0);
new ddb = 10;
MoveObject(bombaid,X,Y,Z-ddb,1);
new ddb2=ddb*1000;
SetTimerEx("explodirBomba",ddb2,false,"dfff",bombaid);
}
return 1;
}
Entao, gostei do code e adaptei ele pra um cmd, so que quando uso crasha o servidor... alguem sabe o porque? obg
pawn Код:
|
if(strcmp("/bombar",cmdtext,true,7)==0)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 476)
{
new bombaid;
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid,X,Y,Z);
bombaid = CreateObject(354,X,Y,Z,0,0,0);
new ddb = 10;
MoveObject(bombaid,X,Y,Z-ddb,1);
new ddb2=ddb*1000;
SetTimerEx("explodirBomba",ddb2,false,"d",bombaid);
}
return 1;
}
//E coloque no Final do GM:
forward explodirBomba(bombaid);
public explodirBomba(bombaid)
{
new Float:X,Float:Y,Float:Z;
GetObjectPos(bombaid,X,Y,Z);
CreateExplosion(X,Y,Z, 6, 20.0);
CreateExplosion(X+1,Y-1,Z, 6, 20.0);
CreateExplosion(X-1,Y+1,Z, 6, 20.0);
CreateExplosion(X+1,Y+1,Z, 6, 20.0);
CreateExplosion(X-1,Y-1,Z, 6, 20.0);
DestroyObject(bombaid);
return 1;
}
C:\Users\Gonзalo.utilizador-PC\Desktop\SAMP - TPD\gamemodes\ZO-RP(3teste).pwn(906) : warning 219: local variable "X" shadows a variable at a preceding level C:\Users\Gonзalo.utilizador-PC\Desktop\SAMP - TPD\gamemodes\ZO-RP(3teste).pwn(906) : warning 219: local variable "Y" shadows a variable at a preceding level C:\Users\Gonзalo.utilizador-PC\Desktop\SAMP - TPD\gamemodes\ZO-RP(3teste).pwn(906) : warning 219: local variable "Z" shadows a variable at a preceding level C:\Users\Gonзalo.utilizador-PC\Desktop\SAMP - TPD\gamemodes\ZO-RP(3teste).pwn(1320) : warning 219: local variable "X" shadows a variable at a preceding level C:\Users\Gonзalo.utilizador-PC\Desktop\SAMP - TPD\gamemodes\ZO-RP(3teste).pwn(1320) : warning 219: local variable "Y" shadows a variable at a preceding level C:\Users\Gonзalo.utilizador-PC\Desktop\SAMP - TPD\gamemodes\ZO-RP(3teste).pwn(1320) : warning 219: local variable "Z" shadows a variable at a preceding level Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 6 Warnings.
new Float:X,Float:Y,Float:Z;