Pickup problem
#1

Hello guys..
Today i made pickup inside gym , the plan was to make dialog so players can choose their fight style.
But i got a little problem, dialog is opening again and again when player go inside of pickup.Player cant select fight style from the list because list item 1 is always selected,even if u try to select other item,its still going back to first item (i guess because server opened again dialog).
Sorry for my bad english, if you need any part of the script just say..
Reply
#2

https://sampwiki.blast.hk/wiki/PickupTypes

TYPE 1 does call the callback all the time, either, use bool to check if player has picked up it lately and setting timer, or selecting other type.
Reply
#3

Thanks, would i be rude if i please you to show me example how to check it/script it ?
Reply
#4

on top of script:
Код:
new bool:pPickedUp[MAX_PLAYERS];

OnPlayerConnect:
pPickedUp[playerid] = false;

OnPlayerPickupPickup:
if(pickupid == ???) {
if(pPickedUp[playerid] == false){
pPickedUp[playerid] = true;
SetTimerEx("ResetPickedUp",10000,false,"i",playerid);
}
}

forward ResetPickedUp(playerid);
public ResetPickedUp(playerid) {
pPickedUp[playerid] = false;
}
I did not test the code, and it is not suppoused to work.
Reply
#5

Thanks a lot, im getting this error, error 032: array index out of bounds (variable "pPickedUp") (pPickedUp[MAX_PLAYERS] = false
Reply
#6

Quote:
Originally Posted by Djumza
Посмотреть сообщение
Thanks a lot, im getting this error, error 032: array index out of bounds (variable "pPickedUp") (pPickedUp[MAX_PLAYERS] = false
MAX_PLAYERS must be there when you define new varriable, otherwise it must be playerid
my mistake, on OnPlayerConnect
Reply
#7

Sorry but i dont get it.. I done everything like you said in your 2nd post, and i got this error : error 032: array index out of bounds (variable "pPickedUp")

Line :
public OnPlayerConnect(playerid)
{
===Error line===> pPickedUp[MAX_PLAYERS] = false;
.....
Reply
#8

I said, I made a problem there...
change it to
pPickedUp[playerid] = false;
Reply
#9

Thank you a lot man.. Sorry im so tired my brain just didnt read "otherwise" ..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)