I'm having a problem on this. - 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 having a problem on this. (
/showthread.php?tid=396004)
I'm having a problem on this. -
Mikkel_RE - 28.11.2012
When i type /grab to pick up weapons it should say "* PlayerName picks up a GunName" but it's bugged, please help me to fix this.
PAWN:
pawn Код:
public gunpick(playerid)
{
for(new i = 0; i < sizeof(DropInfo); i++)
{
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][dAmount]);
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;
}
}
}
}
}
Picture:
Re: I'm having a problem on this. -
park4bmx - 28.11.2012
Change
pawn Код:
format(string,sizeof(string),"* %s picks up a %s",Name(playerid),DropInfo[i][dAmount]);
TO
pawn Код:
format(string,sizeof(string),"* %s picks up a %s",Name(playerid),WeaponNames);
If the gun I'd is the one you retrieved
edit
Also if that don't work then your probbably converting the wrong gun I'd into a string so try this:
pawn Код:
GetWeaponName(DropInfo[i][dAmount], WeaponNames, sizeof(WeaponNames));
Keeping the format I ga e you.
Re: I'm having a problem on this. -
Mikkel_RE - 28.11.2012
I have tried this, but it's the same
Re: I'm having a problem on this. -
park4bmx - 28.11.2012
Quote:
Originally Posted by Mikkel_RE
I have tried this, but it's the same
|
Edited my previous post
Re: I'm having a problem on this. -
Mikkel_RE - 28.11.2012
Thanks it works!