06.05.2018, 12:15
how to pickup an object? i have a createplayerobject and i want when i enter in him, destroy him. how i can do this?
SetTimer("OneSLoop", 1000, 1);
forward OneSLoop();
public OneSLoop(){
for(new i; i < MAX_PLAYERS; i++){
if(IsPlayerInRangeOfPoint(i, 2.0, x, y, z){
DestroyPlayerObject(i, Object[i]);
SendClientMessage(playerid, -1, "You have collected the object! :D");
}
}
}
make a timer that loops:
PHP код:
PHP код:
|
CreateDynamicCircle(Float:x, Float:y, Float:size, worldid = -1, interiorid = -1, playerid = -1)
IsPlayerInDynamicArea(playerid, areaid, recheck = 0)
for(new i; i < MAX_PLAYERS; i++){
if(IsPlayerInRangeOfPoint(i, 2.0, x, y, z){
DestroyPlayerObject(i, Object[i]);
SendClientMessage(playerid, -1, "You have collected the object! :D");
}
}