23.06.2018, 22:42
Include, which implements the ability to check in the callbacks, whether the player aimed at the object or removed the sight from it.
Author: #Samurai aka un[x]pected aka Marmeladova (only at forum.sa-mp.com)
Download: GitHub
Callbacks:
Example of using:
Author: #Samurai aka un[x]pected aka Marmeladova (only at forum.sa-mp.com)
Download: GitHub
Callbacks:
PHP код:
OnPlayerAimAtObject(playerid, objectid)
// playerid - ID of the player who aimed at the object
// objectid - ID of the object the player aimed at (INVALID_OBJECT_ID if the player stops aiming at any objects)
OnPlayerAimAtDynamicObject(playerid, objectid)
// playerid - ID of the player who aimed at the dynamic object
// objectid - ID of the dynamic object the player aimed at (0 if the player stops aiming at any dynamic objects)
PHP код:
public OnPlayerAimAtObject(playerid, objectid)
{
if(objectid == 65535) return SendClientMessage(playerid, -1, "You stopped aiming at the object");
new chatStr[30];
format(chatStr, sizeof(chatStr), "You aimed at the object %i", objectid);
SendClientMessage(playerid, -1, chatStr);
return 1;
}
public OnPlayerAimAtDynamicObject(playerid, objectid)
{
if(objectid == 0) return SendClientMessage(playerid, -1, "You stopped aiming at the dynamic object");
new chatStr[38];
format(chatStr, sizeof(chatStr), "You aimed at the dynamic object %i", objectid);
SendClientMessage(playerid, -1, chatStr);
return 1;
}