/freeze command error
#1

Код:
CMD:freeze(playerid,params[])
{
	if(PlayerInfo[playerid][pAdmin] >= 1)
	{
		new id;
		if(sscanf(params,"u",id)) return SendClientMessage(playerid,-1,"USAGE: /freeze [ID]");
		if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1,"That player is not connected");
		new str[100]
		format(str,sizeof(str),"You have been frozen by an admin.", id); --> Error line.
		SendClientMessage(id, COLOR_RED, str);
		TogglePlayerControllable(id,0);
	}
	return 1;
}
Код:
error 001: expected token: ";", but found "-identifier-"
What am i doing wrong here?
Reply
#2

PHP код:
        if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1,"That player is not connected");
        new 
str[100//<-- NO SEMICOLON HERE!
        
format(str,sizeof(str),"You have been frozen by an admin."id); --> Error line
Solved:
PHP код:
new str[100]; //<-- SEMICOLON IS HERE 
Reply
#3

Quote:
Originally Posted by 10MIN
Посмотреть сообщение
PHP код:
        if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1,"That player is not connected");
        new 
str[100//<-- NO SEMICOLON HERE!
        
format(str,sizeof(str),"You have been frozen by an admin."id); --> Error line
Solved:
PHP код:
new str[100]; //<-- SEMICOLON IS HERE 
Damn, a huge miss i made. Thank you +rep.

EDIT: You must spread some Reputation around before giving it to 10MIN again.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)