SA-MP Forums Archive
OnPlayerPickup - 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: OnPlayerPickup (/showthread.php?tid=633807)



OnPlayerPickup - Loinal - 07.05.2017

PHP код:
public OnPlayerPickUpPickup(playeridpickupid)
{
    if(
pickupid == pgs)
    {
    if(
takenbyplayer == true) { SendClientMessage(playeridCOLOR_YELLOW"* Sorry the hidden pickup already taken by other players"); return 1;}
    new 
szString[128];
    
takenbyplayer true;
    
format(szStringsizeof(szString), "* You have been found the Player hidden pickup and win %d cookies"Max);
    
SendClientMessage(playeridCOLOR_GREENszString);
    
SendClientMessage(playeridCOLOR_GREEN"* You can use your cookies by typing /rocket");
    
pData[playerid][Cookies] += Max;
    new 
test[128], szName[MAX_PLAYER_NAME];
    
GetPlayerName(playeridszNamesizeof(szName));
    
format(test,sizeof(test),"%s has found the ZoneX Hidden pickup and won %d cookies"GetName(playerid), Max);
    new 
IRC[130];
    
format(IRCsizeof(IRC), "0,3* %s has Found the Player Hidden Pickup won %d Cookies.",GetName(playerid),Max);
    
IRC_GroupSay(groupIDIRC_CHANNELIRC);
    
SetTimerEx("pgoos"10000false"i"playerid);
    
DestroyPickup(pgs);
    }
    
    
//House
    
new houseid = -1;
    new 
IDD IsPlayerNearHouse(playerid);
    for(new 
iddidd<MAX_HOUSESidd++)
    {
        if(
HouseInfo[idd][HousePickup] == pickupid)
        {
            
houseid idd;
            break;
        }
    }
    if(
houseid != -1)
    {
        new 
str[128];
        
format(str128"~y~Price: ~w~$%d~n~~y~Owner: ~w~%s~n~~y~House ID: ~w~%d"HouseInfo[houseid][HouseValue], HouseInfo[houseid][HouseOwner], IDD);
        
GameTextForPlayer(playeridstr60003);
        new 
ownerid GetPlayerID(HouseInfo[IDD][HouseOwner]);
        if(
ownerid == playerid)
        {
              
SetPlayerHealth(ownerid,100.0);
            
SetPlayerArmour(ownerid,100.0);
        }
    }
    return 
1;

If iam going to a house pickup it disappear and it shows me "you have been found....." why?


Re: OnPlayerPickup - silverms - 07.05.2017

I fixed it just replace ur code by this https://pastebin.com/JvzEvz3R if the first one didn't work try the second but both should work


Re: OnPlayerPickup - moura98 - 07.05.2017

is you using the plugin streamer?