Two problems - 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: Two problems (
/showthread.php?tid=555125)
Two problems -
nezo2001 - 06.01.2015
First here is the first code
PHP код:
else if(pickupid == mafia || pickupid == bikers || pickupid == grove || pickupid == ballas || pickupid == rifas || pickupid == tirads)
{
if(PlayerInfo[playerid][pGang] > 0)
{
SendClientMessage(playerid, COLOR_RED, "You are already belong to a gang");
}
else
{
TextDrawShowForPlayer(playerid, Text:Textdraw0);
TextDrawShowForPlayer(playerid, Text:Textdraw1);
}
}
it work but it send fo me the client message and doesn't stop sending it
the other problem as you saw up when the player enter pickup it show to him a text draw
and the other code
PHP код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (newkeys & KEY_WALK)
{
if(IsPlayerInRangeOfPoint(playerid, 2, 2176.2573,1663.2335,10.8203))
{
if(PlayerInfo[playerid][pGang] == 0)
{
SendClientMessage(playerid, COLOR_BLUE, "Now, You are part from Mafia Gang");
PlayerInfo[playerid][pGang] = 1;
TextDrawHideForPlayer(playerid, Text:Textdraw0);
TextDrawHideForPlayer(playerid, Text:Textdraw1);
}
else
{
SendClientMessage(playerid, COLOR_RED, "You are already belong to a gang");
}
}
}
return 1;
}
But when i click lalt i make me from the gang and send for me a message but doesn't hide the text draw.
Please help !
Re: Two problems -
nezo2001 - 06.01.2015
Please help
Re: Two problems -
Schneider - 06.01.2015
Try:
pawn Код:
if((newkeys & KEY_WALK) && !(oldkeys & KEY_WALK))
Re: Two problems -
nezo2001 - 06.01.2015
Nothing !
Re: Two problems -
danish007 - 06.01.2015
use this..
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (newkeys & KEY_FIRE)
{
if(IsPlayerInRangeOfPoint(playerid, 2, 2176.2573,1663.2335,10.8203))
{
if(PlayerInfo[playerid][pGang] == 0)
{
SendClientMessage(playerid, COLOR_BLUE, "Now, You are part from Mafia Gang");
PlayerInfo[playerid][pGang] = 1;
TextDrawHideForPlayer(playerid, Textdraw0);
TextDrawHideForPlayer(playerid, Textdraw1);
}
else
{
SendClientMessage(playerid, COLOR_RED, "You are already belong to a gang");
}
}
}
return 1;
}
Re: Two problems -
Rufio - 06.01.2015
Hello,
First of all, your first code seems to be a bit corrupt. If it is called upon "OnPlayerPickUpPickup", that will most likely cause the server repeatedly call your function as person will just keep on picking up the pickup. I'd suggest you to remove it from OnPlayerPickUpPickup if it is so.