Control system
#1

hey so is there a way to make the player control player I have this system but it isn't workin
:
PHP код:
CMD:pmhcontrol(playeridparams[])
{
    if(
adlvl(playerid)<3) return 0;
    new 
pid;
    if(
sscanf(params,"i",pid)) return SendClientMessage(playeridCOLOR_WHITE"USAGE: /control [playerid]");
    
TogglePlayerSpectating(playerid1);
    
PlayerSpectatePlayer(playeridpid);
    
SendClientMessage(playerid0xFF0000FF"Control the player using W,S,A,D!");
    
CallLocalFunction("lel""dd"playeridpid);
    
SetTimerEx("lel"1true"i"playerid);
    
SetPlayerFacingAngle(pid0);
    
control[playerid] = 1;
    return 
1;
}
public 
lel(playeridid)
{
    if(
control[playerid] == 1) {
    new 
Keys,ud,lr;
    
GetPlayerKeys(playerid,Keys,ud,lr);
    if(
ud == KEY_UP) return SetPlayerVelocity(id0.20.00.0);
    else if(
ud == KEY_DOWN) return SetPlayerVelocity(id, -0.20.00.0);
    if(
lr == KEY_LEFT) return SetPlayerVelocity(id0.00.20.0);
    else if(
lr == KEY_RIGHT) return SetPlayerVelocity(id0.0, -0.20.0); }
    return 
1;

Reply
#2

You should do that with
PHP код:
public OnPlayerUpdate(playerid
and not a timer.
Reply
#3

thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)