Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- if(pickupid == pgs)
- {
- if(takenbyplayer == true) return SendClientMessage(playerid, COLOR_YELLOW, "* Sorry the hidden pickup already taken by other players");
- new szString[128];
- takenbyplayer = true;
- format(szString, sizeof(szString), "* You have been found the Player hidden pickup and got %d cookies", Max);
- SendClientMessage(playerid, COLOR_GREEN, szString);
- SendClientMessage(playerid, COLOR_GREEN, "* You can use your cookies by typing /rocket");
- pData[playerid][Cookies] += Max;
- new test[128], szName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, szName, sizeof(szName));
- format(test,sizeof(test),"%s has found the ZoneX Hidden pickup and won %d cookies", GetName(playerid), Max);
- new IRC[130];
- format(IRC, sizeof(IRC), "0,3* %s has Found the Player Hidden Pickup won %d Cookies.",GetName(playerid),Max);
- IRC_GroupSay(groupID, IRC_CHANNEL, IRC);
- SetTimerEx("pgoos", 10000, false, "i", playerid);
- DestroyPickup(pgs);
- return 1;
- }
- //House
- new houseid = -1;
- new IDD = IsPlayerNearHouse(playerid);
- for(new idd; idd<MAX_HOUSES; idd++)
- {
- if(HouseInfo[idd][HousePickup] == pickupid)
- {
- houseid = idd;
- break;
- }
- }
- if(houseid != -1)
- {
- new str[128];
- format(str, 128, "~y~Price: ~w~$%d~n~~y~Owner: ~w~%s~n~~y~House ID: ~w~%d", HouseInfo[houseid][HouseValue], HouseInfo[houseid][HouseOwner], IDD);
- GameTextForPlayer(playerid, str, 6000, 3);
- new ownerid = GetPlayerID(HouseInfo[IDD][HouseOwner]);
- if(ownerid == playerid)
- {
- SetPlayerHealth(ownerid,100.0);
- SetPlayerArmour(ownerid,100.0);
- }
- }
- return 1;
- }
- //NOTE: if this didn't work try this
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- if(pickupid == pgs)
- {
- if(takenbyplayer == true) return SendClientMessage(playerid, COLOR_YELLOW, "* Sorry the hidden pickup already taken by other players");
- new szString[128];
- takenbyplayer = true;
- format(szString, sizeof(szString), "* You have been found the Player hidden pickup and got %d cookies", Max);
- SendClientMessage(playerid, COLOR_GREEN, szString);
- SendClientMessage(playerid, COLOR_GREEN, "* You can use your cookies by typing /rocket");
- pData[playerid][Cookies] += Max;
- new test[128], szName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, szName, sizeof(szName));
- format(test,sizeof(test),"%s has found the ZoneX Hidden pickup and won %d cookies", GetName(playerid), Max);
- new IRC[130];
- format(IRC, sizeof(IRC), "0,3* %s has Found the Player Hidden Pickup won %d Cookies.",GetName(playerid),Max);
- IRC_GroupSay(groupID, IRC_CHANNEL, IRC);
- SetTimerEx("pgoos", 10000, false, "i", playerid);
- DestroyPickup(pgs);
- }
- else
- {
- new houseid = -1;
- new IDD = IsPlayerNearHouse(playerid);
- for(new idd; idd<MAX_HOUSES; idd++)
- {
- if(HouseInfo[idd][HousePickup] == pickupid)
- {
- houseid = idd;
- break;
- }
- }
- if(houseid != -1)
- {
- new str[128];
- format(str, 128, "~y~Price: ~w~$%d~n~~y~Owner: ~w~%s~n~~y~House ID: ~w~%d", HouseInfo[houseid][HouseValue], HouseInfo[houseid][HouseOwner], IDD);
- GameTextForPlayer(playerid, str, 6000, 3);
- new ownerid = GetPlayerID(HouseInfo[IDD][HouseOwner]);
- if(ownerid == playerid)
- {
- SetPlayerHealth(ownerid,100.0);
- SetPlayerArmour(ownerid,100.0);
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement