EnablePlayerCameraTarget INVALID_PLAYER_ID
#1

PHP код:

public OnPlayerConnect(playerid)
{
     
EnablePlayerCameraTarget(playerid1);
     return 
1;
}
public 
OnPlayerWeaponShot(playeridweaponidhittypehitidFloat:fXFloat:fYFloat:fZ)
{
    new 
MSG2[25];
    
format(MSG2sizeof(MSG2), "%s"PlayerName(GetPlayerCameraTargetPlayer(playerid)));
    
GameTextForPlayer(playeridMSG25003);
    return 
1;
}
CMD:test(playeridparams[])
{
    new 
MSG2[25];
    new 
TargetID=GetPlayerCameraTargetPlayer(playerid);
    new 
ObjectID=GetPlayerCameraTargetObject(playerid);
    
sscanf(params"u"playerid);
    
format(MSG2sizeof(MSG2), "%i"TargetID);
    
SendClientMessage(playerid, -1MSG2);
    
format(MSG2sizeof(MSG2), "%i"ObjectID);
    
SendClientMessage(playerid, -1MSG2);

It gives me Invalid PlayerID even when I am near someone.. Like close to his nose.. Or away like 1m..
Am I doing it wrong?
This is just a test command..
Reply
#2

Does it work for vehicles / objects?
Reply
#3

Dint check that.. Since its in my Test server, I had no Vehicle/Object to do so.. Will check it when I get back home
Reply
#4

You can't target an player/vehicle/object, if you're typing an command
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)