CMD:back(playerid, params[]) { new name[MAX_PLAYER_NAME], string[128]; new not; not=TogglePlayerControllable(playerid, 1); if(not=TogglePlayerControllable(playerid, 1)) { SCM(playerid, -1, "g"); } GetPlayerName(playerid, name, MAX_PLAYER_NAME); format(string, sizeof(string), "%s back from Afk.", name); SCMTA(0xFFFF00, string); TogglePlayerControllable(playerid, 1); return 1; }
C:\Users\Kurdi's\Desktop\samp037_svr_R2-1-1_win32\gamemodes\FirstCode.pwn(143) : warning 211: possibly unintended assignment C:\Users\Kurdi's\Desktop\samp037_svr_R2-1-1_win32\gamemodes\FirstCode.pwn(143) : warning 204: symbol is assigned a value that is never used: "not" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Warnings.
CMD:back(playerid, params[])
{
new name[MAX_PLAYER_NAME], string[128];
if(TogglePlayerControllable(playerid, TRUE))
{
SCM(playerid, -1, "g");
}
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s back from Afk.", name);
SCMTA(0xFFFF00, string);
TogglePlayerControllable(playerid, TRUE);
return 1;
}
https://sampwiki.blast.hk/wiki/Function:...erControllable
Use TogglePlayerControllable(playerid, 1); to allow the player control, or TogglePlayerControllable(playerid, 0); to disable control. |