View Full Version : Material of pickup

02/03/2015, 07:02 PM
Is there any way to change material of pickup?

02/03/2015, 10:00 PM
Mind telling us more details please ?
If you mean SetObjectMaterial, then the answer is no.
Solution : create a small object that has same model as the pickup, set its material. the object should be an arraylist so you can loop through it if you have many pickups. I have made a little helpful stock :

stock IsPlayerInRangeOfObject(playerid, objectid, Float:distance=2.0)
new Float:oX, Float:oY, Float:oZ;
GetObjectPos(objectid, oX, oY, oZ);
if(IsPlayerInRangeOfPoint(playerid, distance,oX,oY,oZ)) return true;
return false;

and if it returns true, then execute what you need ( tp to a zone, give gun, cash ...)

Edit : if you are going to have many pickups you need to have em like :
PickUp[MAX_PICKUPS]; PickUp[0] , PickUp[1] ...
And for(new i=0;i<MAX_PICKUPS;i++) IsPlayerInRangeOfObject(playerid, PickUp[i], Float:distance=2.0)
I hope that was clear