SA-MP Forums Archive
MineExplode-Script - 1 Error - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: MineExplode-Script - 1 Error (/showthread.php?tid=186358)



MineExplode-Script - 1 Error - XCarBOn - 28.10.2010

Hello,


here's my problem:


pawn Код:
new Float:Bombenpkt[14][3] = {
{284.11062622,1742.19189453,19.10804176},
{190.96379089,1690.42700195,19.10804176},
{136.22543335,1741.16479492,19.10804176},
{28.86712074,1674.37341309,19.10804176},
{-19.31500053,1742.93286133,19.10804176},
{48.79174805,1813.67553711,19.10804176},
{-4.14370537,1905.34301758,19.10804176},
{74.65625763,1964.73071289,19.10804176},
{111.43378448,2096.27416992,19.10804176},
{258.37670898,2107.98120117,19.10804176},
{397.12628174,2084.69531250,19.10804176},
{413.42593384,1954.53125000,19.10804176},
{361.07113647,1842.04956055,19.10804176},
{344.92239380,1797.48559570,19.10804176}
};


Next part:


public MineExplode(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid, 10, Bombenpkt[0], Bombenpkt[1], Bombenpkt[2]))// EDIT at this line.. But it don't dixed the Error 035: argument type mismatch (argument 3)
    {
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    CreateExplosion(x, y, z, 2, 10);
    SendClientMessage(playerid, COLOR_RED, "Du bist in eine Mine geraten. Die Mainbase ist ein gefдhrlicher Ort! Halte dich fern!");
    return 1;
    }
}
Any solutions? I don't want to make random explodings.. When a player enter this point he will explode.


Thanks!


Re: MineExplode-Script - 1 Error - MJ! - 28.10.2010

you forgot to put IF

IsPlayerInRangeOfPoint

must be

if(IsPlayerInRangeOfPoint


Re: MineExplode-Script - 1 Error - Hornet600 - 28.10.2010

Didnt understand what you mean can i give details and what is the error?


Re: MineExplode-Script - 1 Error - Mike_Peterson - 28.10.2010

Код:
new Float:Bombenpkt[14][3] = {
{284.11062622,1742.19189453,19.10804176},
{190.96379089,1690.42700195,19.10804176},
{136.22543335,1741.16479492,19.10804176},
{28.86712074,1674.37341309,19.10804176},
{-19.31500053,1742.93286133,19.10804176},
{48.79174805,1813.67553711,19.10804176},
{-4.14370537,1905.34301758,19.10804176},
{74.65625763,1964.73071289,19.10804176},
{111.43378448,2096.27416992,19.10804176},
{258.37670898,2107.98120117,19.10804176},
{397.12628174,2084.69531250,19.10804176},
{413.42593384,1954.53125000,19.10804176},
{361.07113647,1842.04956055,19.10804176},
{344.92239380,1797.48559570,19.10804176}
};


Next part:


public MineExplode(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 10, Bombenpkt[0], Bombenpkt[1], Bombenpkt[2]))// Error 035: argument type mismatch (argument 3)
    {
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    CreateExplosion(x, y, z, 2, 10);
    SendClientMessage(playerid, COLOR_RED, "Du bist in eine Mine geraten. Die Mainbase ist ein gefдhrlicher Ort! Halte dich fern!");
    return 1;
    }
}



Re: MineExplode-Script - 1 Error - XCarBOn - 28.10.2010

MJ!, thanks.. forgot that xD But the error ist still there.. It's not the solution. It's an error of this arrays:


pawn Код:
Bombenpkt[0]// I can change it to Bombenpkt[1][0] this solute the error.. but i want that the system checks if the player is in reach of this points.. so a check for every point, not for ONE point.



Re: MineExplode-Script - 1 Error - Nero_3D - 28.10.2010

First of all a little array explanation
pawn Код:
new Array[][] =
{ //    |0||1||2|
/* 0 */ {5, 8, 3}, //5 = Array[0][0], 8 = Array[0][1], 3 = Array[0][2]
/* 1 */ {7, 4, 9}  //7 = Array[1][0], 4 = Array[1][1], 9 = Array[1][2]
}
Now if we call Array[0] we get the array {5, 8, 3}, so if you call Bombenpkt[0] you get an array but we need a float => Argument type mistake

And if we want it for all mines we need to loop through all cords

pawn Код:
public MineExplode(playerid)
{
    for(new i; i < sizeof Bombenpkt; i++)
    {
        if(IsPlayerInRangeOfPoint(playerid, 5, Bombenpkt[i][0], Bombenpkt[i][1], Bombenpkt[i][2])) //Radius changed to 5
        {
            SendClientMessage(playerid, COLOR_RED, "Du bist in eine Mine geraten. Die Mainbase ist ein gefдhrlicher Ort! Halte dich fern!");
            return CreateExplosion(Bombenpkt[i][0], Bombenpkt[i][1], Bombenpkt[i][2], 2, 10); //The mine should explode where it is
        }
    }
}
And I suggest to use a timer for all players, not one for each