I've Errors For This CMD
#1

I Have This CMD and i have these errors:
CMD:
Код:
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;
}
Errors:


Код:
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.
Help please
Reply
#2

You don't need to save TogglePlayerControllable on not You could just directly call it.
PHP код:
CMD:back(playeridparams[])
{
    new 
name[MAX_PLAYER_NAME], string[128];
    if(
TogglePlayerControllable(playeridTRUE))
    {
    
SCM(playerid, -1"g");
    }
    
GetPlayerName(playeridnameMAX_PLAYER_NAME);
    
format(stringsizeof(string), "%s back from Afk."name);
    
SCMTA(0xFFFF00string);
    
TogglePlayerControllable(playeridTRUE);
    return 
1;

Reply
#3

Error:
Undefined:TRUE
Reply
#4

https://sampwiki.blast.hk/wiki/Function:...erControllable
Use TogglePlayerControllable(playerid, 1); to allow the player control, or TogglePlayerControllable(playerid, 0); to disable control.
Reply
#5

its not TRUE its true

Quote:
Originally Posted by MEW273
Посмотреть сообщение
https://sampwiki.blast.hk/wiki/Function:...erControllable
Use TogglePlayerControllable(playerid, 1); to allow the player control, or TogglePlayerControllable(playerid, 0); to disable control.
it doesnt matter true = 1 false = 0

it just should be lower case
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)