SA-MP Forums Archive
EnablePlayerCameraTarget INVALID_PLAYER_ID - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: EnablePlayerCameraTarget INVALID_PLAYER_ID (/showthread.php?tid=576075)



EnablePlayerCameraTarget INVALID_PLAYER_ID - Mic_H - 31.05.2015

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..


Re: EnablePlayerCameraTarget INVALID_PLAYER_ID - Abagail - 31.05.2015

Does it work for vehicles / objects?


Re: EnablePlayerCameraTarget INVALID_PLAYER_ID - Mic_H - 01.06.2015

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


AW: EnablePlayerCameraTarget INVALID_PLAYER_ID - Kaliber - 01.06.2015

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