Need a Little Help in This CMD (rep+++++)
#1

Guys i have this CMD..

pawn Код:
COMMAND:airstrike(playerid, params[])
{
    if(GetPlayerScore(playerid) < 2000) return SendClientMessage(playerid, 0xFF0000FF, "You don't have enough score, you need 2000 score");
    if(GetPlayerMoney(playerid) < 10000) return SendClientMessage(playerid, 0xFF0000FF, "You don't have enough money.");
    GivePlayerMoney(playerid,-10000);
    SendClientMessage(playerid, 0xFF0000FF, "Air Strike Successfully Done!");
    SetTimerEx("ExplodeBomb", 5000, false, "i", playerid);
    return 1;
}
public ExplodeBomb(playerid)
{
    new Float: Pos[3];
    GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
    CreateExplosion(Pos[0], Pos[1], Pos[2], 7, 20.0);
    return 1;
}
====> When i type /airstrike it explode after 5 sec (thats what i need) but it do not explode on the position where i was standing but explode on me... Please i need that it explodes on the position where i type /airstrike that is where i was standing last....
Reply
#2

pawn Код:
COMMAND:airstrike(playerid, params[])
{
    if(GetPlayerScore(playerid) < 2000) return SendClientMessage(playerid, 0xFF0000FF, "You don't have enough score, you need 2000 score");
    if(GetPlayerMoney(playerid) < 10000) return SendClientMessage(playerid, 0xFF0000FF, "You don't have enough money.");
    GivePlayerMoney(playerid,-10000);
    new Float:Pos[3];
    GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
    SendClientMessage(playerid, 0xFF0000FF, "Air Strike Successfully Done!");
    SetTimerEx("ExplodeBomb", 5000, false, "ifff", playerid, Pos[0], Pos[1], Pos[2]);
    return 1;
}
public ExplodeBomb(playerid, Float:PosX, Float:PosY, Float:PosZ)
{
    CreateExplosion(PosX, PosY, Z, 7, 20.0);
    return 1;
}
This should work.
Reply
#3

Giving these errors........

pawn Код:
D:\Game\SA-MP Files\SF Wars\gamemodes\Wars.pwn(1217) : error 025: function heading differs from prototype
D:\Game\SA-MP Files\SF Wars\gamemodes\Wars.pwn(1219) : error 017: undefined symbol "Z"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.
Reply
#4

pawn Код:
CreateExplosion(PosX, PosY, PosZ, 7, 20.0);
Reply
#5

Quote:
Originally Posted by iOmar
Посмотреть сообщение
====> When i type /airstrike it explode after 5 sec (thats what i need) but it do not explode on the position where i was standing but explode on me... Please i need that it explodes on the position where i type /airstrike that is where i was standing last....
You have scripted the positions(floats) on the player not near or beside him!!

Код:
CreateExplosion(PosX, PosY, PosZ, 7, 20.0);

PosX, PosY, PosZ = positions(floats) you know that already!

This "7" is the type of bomb "TYPES"

This "20.0" Is the explosion radius.
Reply
#6

so how can i dot it??
pawn Код:
D:\Game\SA-MP Files\SF Wars\gamemodes\Wars.pwn(1217) : error 017: undefined symbol "PosX"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Reply
#7

Код:
public ExplodeBomb(playerid)
{
    new Float:PosX, Float:PosY, Float:PosZ;
    CreateExplosion(PosX, PosY, PosZ, 7, 20.0);
    return 1;
}
It is the same but in other way(I compiled it and it worked without receiving any errors or warnings)
Reply
#8

I did this. Is is giving this error:
pawn Код:
D:\Game\SA-MP Files\SF Wars\gamemodes\Wars.pwn(1216) : error 017: undefined symbol "Z"
D:\Game\SA-MP Files\SF Wars\gamemodes\Wars.pwn(1215) : warning 203: symbol is never used: "PosZ"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
And when i try to add "PosZ" than it compile fine but in game nothing happens??
Reply
#9

Quote:
Originally Posted by iOmar
Посмотреть сообщение
I did this. Is is giving this error:
pawn Код:
D:\Game\SA-MP Files\SF Wars\gamemodes\Wars.pwn(1216) : error 017: undefined symbol "Z"
D:\Game\SA-MP Files\SF Wars\gamemodes\Wars.pwn(1215) : warning 203: symbol is never used: "PosZ"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
And when i try to add "PosZ" than it compile fine but in game nothing happens??
you tried my code?
Reply
#10

Quote:
Originally Posted by Youice
Посмотреть сообщение
Код:
public ExplodeBomb(playerid)
{
    new Float:PosX, Float:PosY, Float:PosZ;
    CreateExplosion(PosX, PosY, PosZ, 7, 20.0);
    return 1;
}
It is the same but in other way(I compiled it and it worked without receiving any errors or warnings)
No offence but you have no idea what you're doing. Let's analyze your code. So, you create 3 new floats, which, by creation are 0.0; 0.0; 0.0. And now you create an explosion at those coordinates. Cool. Why do you even need the 'playerid' param in the function ?

pawn Код:
COMMAND:airstrike(playerid, params[])
{
    if(GetPlayerScore(playerid) < 2000) return SendClientMessage(playerid, 0xFF0000FF, "You don't have enough score, you need 2000 score");
    if(GetPlayerMoney(playerid) < 10000) return SendClientMessage(playerid, 0xFF0000FF, "You don't have enough money.");
    GivePlayerMoney(playerid,-10000);
    new Float:Pos[3];
    GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
    SendClientMessage(playerid, 0xFF0000FF, "Air Strike Successfully Done!");
    SetTimerEx("ExplodeBomb", 5000, false, "ifff", playerid, Pos[0], Pos[1], Pos[2]);
    return 1;
}
forward ExplodeBomb(playerid, Float:PosX, Float:PosY, Float:PosZ);
public ExplodeBomb(playerid, Float:PosX, Float:PosY, Float:PosZ)
{
    SendClientMessage(playerid, -1, "BOOOOOOM! ! ! !");
    CreateExplosion(PosX, PosY, PosZ, 7, 20.0);
    return 1;
}

This should work.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)