I'm getting fatal errors :( - 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)
+--- Thread: I'm getting fatal errors :( (
/showthread.php?tid=395566)
I'm getting fatal errors :( -
Mikkel_RE - 26.11.2012
Hi, im making that there's a timer on 3 seconds till you get the weapon in your hands, but i'm getting fatal errors when i'm trying to compile, can you help me please.
Here's the code:
pawn Код:
forward gunpick(playerid);
public gunpick(playerid)
{
for(new i = 0; i < sizeof(DropInfo); i++)
{
if(gunpick[playerid])
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
if(PlayerPosition[playerid][PosX] == X && PlayerPosition[playerid][PosY] == Y && PlayerPosition[playerid][PosZ] == Z)
{
if (PlayerToPoint(1.0,playerid,DropInfo[i][dx],DropInfo[i][dy],DropInfo[i][dz]))
{
if(GetPlayerVirtualWorld(playerid) == DropInfo[i][dWorld])
{
DestroyObject(DropObject[i]);
DropInfo[i][dx] = 0.0;
DropInfo[i][dy] = 0.0;
DropInfo[i][dz] = 0.0;
if(DropInfo[i][dType] == 1) // Weapons
{
new string[256];
new WeaponNames[25];
new gunID = GetPlayerWeapon(playerid);
GetWeaponName(gunID, WeaponNames, sizeof(WeaponNames));
format(string,sizeof(string),"* %s picks up a %s",Name(playerid),DropInfo[i][dType]);
ProxDetector(30.0,playerid,string,COLOR_RED,COLOR_RED,COLOR_RED,COLOR_RED,COLOR_RED);
AddWeapon(playerid,DropInfo[i][dAmount][0],DropInfo[i][dAmount][1]);
DropInfo[i][dAmount][0] = 0;
DropInfo[i][dAmount][1] = 0;
DropInfo[i][dType] = 0;
}
else
{
AfkTimerTimer[playerid] = 0;
SendClientMessage(playerid, COLOR_GREY, " You have moved from your position !");
return 1;
}
}
}
}
}
}
}
}
Re: I'm getting fatal errors :( -
mastermax7777 - 27.11.2012
Try this:
pawn Код:
forward gunpick(playerid);
public gunpick(playerid)
{
for(new i = 0; i < sizeof(DropInfo); i++)
{
if(gunpick[playerid])
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
if(PlayerPosition[playerid][PosX] == X && PlayerPosition[playerid][PosY] == Y && PlayerPosition[playerid][PosZ] == Z)
{
if (PlayerToPoint(1.0,playerid,DropInfo[i][dx],DropInfo[i][dy],DropInfo[i][dz]))
{
if(GetPlayerVirtualWorld(playerid) == DropInfo[i][dWorld])
{
DestroyObject(DropObject[i]);
DropInfo[i][dx] = 0.0;
DropInfo[i][dy] = 0.0;
DropInfo[i][dz] = 0.0;
if(DropInfo[i][dType] == 1) // Weapons
{
new string[256];
new WeaponNames[25];
new gunID = GetPlayerWeapon(playerid);
GetWeaponName(gunID, WeaponNames, sizeof(WeaponNames));
format(string,sizeof(string),"* %s picks up a %s",Name(playerid),DropInfo[i][dType]);
ProxDetector(30.0,playerid,string,COLOR_RED,COLOR_RED,COLOR_RED,COLOR_RED,COLOR_RED);
AddWeapon(playerid,DropInfo[i][dAmount][0],DropInfo[i][dAmount][1]);
DropInfo[i][dAmount][0] = 0;
DropInfo[i][dAmount][1] = 0;
DropInfo[i][dType] = 0;
}
else
{
AfkTimerTimer[playerid] = 0;
SendClientMessage(playerid, COLOR_GREY, " You have moved from your position !");
return 1;
}
}
}
}
}
}
}