Please close this thread problem done.
#1

pawn Code:
public OnPlayerPickUpPickup(playerid, pickupid)
{
new str[256];
format(str,256,"You found %d Bombs",AccountInfo[playerid][unlock]);
if(pickupid == p1)
{
if(AccountInfo[playerid][up1] == 0)
{
SendClientMessage(playerid,LIGHTGREEN,str);
AccountInfo[playerid][unlock] ++;
AccountInfo[playerid][up1] = 1;
}
else
if(AccountInfo[playerid][up1] == 1)
{
SendClientMessage(playerid,ADMIN_RED,"You already picked up this pickup.");
}
}}
when i pickup the pickup it says "You found 0Bombs" eventho AccountInfo[playerid][unlock] already equals 1
so it should be 1Bombs and it shouldnt be You found blah...
because AccountInfo[playerid][up1] equals 1...
could u tell me whats the problem?
Reply
#2

Put your SendClientMessage after AccountInfo[playerid][unlock] ++;
Reply
#3

didnt really help still the same shit happens
Reply
#4

pawn Code:
public OnPlayerPickUpPickup(playerid, pickupid)
{
new str[256];
format(str,256,"You found %d Bombs",AccountInfo[playerid][unlock]);
if(pickupid == p1)
{
if(AccountInfo[playerid][up1] == 0)
{
AccountInfo[playerid][unlock] ++;
AccountInfo[playerid][up1] = 1;
SendClientMessage(playerid,LIGHTGREEN,str);
}
else
if(AccountInfo[playerid][up1] == 1)
{
SendClientMessage(playerid,ADMIN_RED,"You already picked up this pickup.");
}
}
}
Reply
#5

still the same problems
imma send the whole OnPlayerPickupPickup maybe u see an error then..
pawn Code:
public OnPlayerPickUpPickup(playerid, pickupid)
{
new str[256];
format(str,256,"You found %d Bombs",AccountInfo[playerid][unlock]);
if(pickupid == 1)
{
SetPlayerHealth(playerid,100);
}
if(pickupid == 2)
{
SetPlayerArmour(playerid,50);
}
if(pickupid == 3)
{
SetPlayerArmour(playerid,50);
}
if(pickupid == 4)
{
SetPlayerHealth(playerid,100);
}
if(pickupid == 5)
{
SetPlayerHealth(playerid,100);
}
if(pickupid == p1)
{
if(AccountInfo[playerid][up1] == 0)
{
AccountInfo[playerid][unlock] ++;
AccountInfo[playerid][up1] = 1;
SendClientMessage(playerid,LIGHTGREEN,str);
}
else
if(AccountInfo[playerid][up1] == 1)
{
SendClientMessage(playerid,ADMIN_RED,"You already picked up this pickup.");
}
}
if(pickupid == p2)
{
if(AccountInfo[playerid][up2] == 0)
{
SendClientMessage(playerid,LIGHTGREEN,str);
AccountInfo[playerid][up2] = 1;
AccountInfo[playerid][unlock] ++;
}
else
if(AccountInfo[playerid][up2] == 1)
{
SendClientMessage(playerid,ADMIN_RED,"You already picked up this pickup.");
}
}
if(pickupid == p3)
{
if(AccountInfo[playerid][up3] == 0)
{
SendClientMessage(playerid,LIGHTGREEN,str);
AccountInfo[playerid][up3] = 1;
AccountInfo[playerid][unlock] ++;
}
else
if(AccountInfo[playerid][up3] == 1)
{
SendClientMessage(playerid,ADMIN_RED,"You already picked up this pickup.");
}
}
if(pickupid == p4)
{
if(AccountInfo[playerid][up4] == 0)
{
SendClientMessage(playerid,LIGHTGREEN,str);
AccountInfo[playerid][up4] = 1;
AccountInfo[playerid][unlock] ++;
}
else
if(AccountInfo[playerid][up4] == 1)
{
SendClientMessage(playerid,ADMIN_RED,"You already picked up this pickup.");
}
}
if(pickupid == p5)
{
if(AccountInfo[playerid][up5] == 0)
{
SendClientMessage(playerid,LIGHTGREEN,str);
AccountInfo[playerid][up5] = 1;
AccountInfo[playerid][unlock] ++;
}
else
if(AccountInfo[playerid][up5] == 1)
{
SendClientMessage(playerid,ADMIN_RED,"You already picked up this pickup.");
}
}
if(pickupid == p6)
{
if(AccountInfo[playerid][up6] == 0)
{
SendClientMessage(playerid,LIGHTGREEN,str);
AccountInfo[playerid][up6] = 1;
AccountInfo[playerid][unlock] ++;
}
else
if(AccountInfo[playerid][up6] == 1)
{
SendClientMessage(playerid,ADMIN_RED,"You already picked up this pickup.");
}
}
if(pickupid == p7)
{
if(AccountInfo[playerid][up7] == 0)
{
SendClientMessage(playerid,LIGHTGREEN,str);
AccountInfo[playerid][up7] = 1;
AccountInfo[playerid][unlock] ++;
}
else
if(AccountInfo[playerid][up7] == 1)
{
SendClientMessage(playerid,ADMIN_RED,"You already picked up this pickup.");
}
}
if(pickupid == p8)
{
if(AccountInfo[playerid][up8] == 0)
{
SendClientMessage(playerid,LIGHTGREEN,str);
AccountInfo[playerid][up8] = 1;
AccountInfo[playerid][unlock] ++;
}
else
if(AccountInfo[playerid][up8] == 1)
{
SendClientMessage(playerid,ADMIN_RED,"You already picked up this pickup.");
}
}
if(pickupid == p9)
{
if(AccountInfo[playerid][up9] == 0)
{
SendClientMessage(playerid,LIGHTGREEN,str);
AccountInfo[playerid][up9] = 1;
AccountInfo[playerid][unlock] ++;
}
else
if(AccountInfo[playerid][up9] == 1)
{
SendClientMessage(playerid,ADMIN_RED,"You already picked up this pickup.");
}
}
return 1;
}
Reply
#6

tried to change the way now
pawn Code:
public OnPlayerPickUpPickup(playerid, pickupid)
{
new str[256];
format(str,256,"You found %d Bombs",AccountInfo[playerid][unlock]);
if(pickupid == p1)
{
if(AccountInfo[playerid][up1] == 1)
{
SendClientMessage(playerid,ADMIN_RED,"You already picked up this pickup.");
}
else
if(AccountInfo[playerid][up1] == 0)
{
AccountInfo[playerid][unlock] ++;
AccountInfo[playerid][up1] = 1;
SendClientMessage(playerid,LIGHTGREEN,str);
}
}
}
but still it does go around the
pawn Code:
if(AccountInfo[playerid][up1] == 1)
{
SendClientMessage(playerid,ADMIN_RED,"You already picked up this pickup.");
}
Please Help
Reply
#7

why do you format a message and then change a var and only then send a message? format AFTER variable changes and send message then.
Reply
#8

pawn Code:
public OnPlayerPickUpPickup(playerid, pickupid)
{
new str[256];
format(str,256,"You found %d Bombs",AccountInfo[playerid][unlock]);
if(pickupid == p1)
{
if(AccountInfo[playerid][up1] == 1)
{
SendClientMessage(playerid,ADMIN_RED,"You already picked up this pickup.");
}
else
if(AccountInfo[playerid][up1] == 0)
{
AccountInfo[playerid][unlock] ++;
AccountInfo[playerid][up1] = 1;
SendClientMessage(playerid,LIGHTGREEN,str);
return 1;
}
Try that one.
Reply
#9

@Coop, I recommend you to read this post again

Quote:
Originally Posted by Izanagi
why do you format a message and then change a var and only then send a message? format AFTER variable changes and send message then.
Reply
#10

Quote:
Originally Posted by Izanagi
why do you format a message and then change a var and only then send a message? format AFTER variable changes and send message then.
well i fixed that already only thing annoying me atm is that it does go around the if(AccountInfo[playerid][up1] == 1)
like ti doesnt show

and @coop: sry didnt put the return in the pawn code here but in the fs it is
Reply
#11

Quote:
Originally Posted by ♣ ⓐⓢⓢ
@Coop, I recommend you to read this post again
It was just a suggestion...
Reply
#12

Quote:
Originally Posted by cοοp
Quote:
Originally Posted by ♣ ⓐⓢⓢ
@Coop, I recommend you to read this post again
It was just a suggestion...
ye ty for that man^-^

and erm..
dunno how but i fixed the prob on my own.
weird...
Reply
#13

well grats in doing so I go watch a movie now so I will be out of reach. Good luck whith whatever yo're scripting
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)