/setname command help
#1

So this is the code:

Код:
CMD:setname(playerid,params[])
{
	if(Info[playerid][Level] >= 2 || IsPlayerAdmin(playerid))
	{
	    new id, name[24], str[130], newname;
	    if(sscanf(params, "udd", id,name,newname)) return SendClientMessage(playerid,red,"/SetName [Playerid/Name] [New Name]");
	    GetPlayerName(id,name,24)
		format(str,130,"You Changed %s (%d)'s Name to $%d",name,id,newname);
		SendClientMessage(playerid,lightblue,str);
		format(str,130, "Admin Changed Your Name to $%d",newname);
		SendClientMessage(playerid,lightblue,str);
		SetPlayerName(id,name);
	} else return SendClientMessage(playerid,red,"Your Level Is Not High Enough To Use This Command");
	return 1;
}
And i get this error:

Код:
C:\Documents and Settings\Matej & Mario\Desktop\admin script test\filterscripts\admin.pwn(908) : error 001: expected token: ";", but found "-identifier-"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Pls help.
Reply
#2

Hey Where Line 908
Reply
#3

format(str,130,"You Changed %s (%d)'s Name to $%d",name,id,newname);
Reply
#4

use this

[pawn]CMDetname(playerid,params[])
{
if(Info[playerid][Level] >= 2 || IsPlayerAdmin(playerid))
{
new id, name[24], str[130], newname;
if(sscanf(params, "udd", id,name,newname)) return SendClientMessage(playerid,red,"/SetName [Playerid/Name] [New Name]");
GetPlayerName(id,name,24);
format(str,130,"You Changed %s (%d)'s Name to $%d",name,id,newname);
SendClientMessage(playerid,lightblue,str);
format(str,130, "Admin Changed Your Name to $%d",newname);
SendClientMessage(playerid,lightblue,str);
SetPlayerName(id,name);
} else return SendClientMessage(playerid,red,"Your Level Is Not High Enough To Use This Command");
return 1;
}/pawn]
Reply
#5

Quote:
Originally Posted by Indian
Посмотреть сообщение
use this

[pawn]CMDetname(playerid,params[])
{
if(Info[playerid][Level] >= 2 || IsPlayerAdmin(playerid))
{
new id, name[24], str[130], newname;
if(sscanf(params, "udd", id,name,newname)) return SendClientMessage(playerid,red,"/SetName [Playerid/Name] [New Name]");
GetPlayerName(id,name,24);
format(str,130,"You Changed %s (%d)'s Name to $%d",name,id,newname);
SendClientMessage(playerid,lightblue,str);
format(str,130, "Admin Changed Your Name to $%d",newname);
SendClientMessage(playerid,lightblue,str);
SetPlayerName(id,name);
} else return SendClientMessage(playerid,red,"Your Level Is Not High Enough To Use This Command");
return 1;
}/pawn]
Not working, you did not change error line..

error is in this line:

Код:
format(str,130,"You Changed %s (%d)'s Name to $%d",name,id,newname);
Reply
#6

pawn Код:
format(str,130,"You Changed %s (%d)'s Name to $%d");
        SendClientMessage(playerid,lightblue,str,name,id,newname);
Reply
#7

not working, again same error
Reply
#8

Sorry
Try
pawn Код:
format(str,130,"You Changed %s (%d)'s Name to $%d",name,id,newname)
        SendClientMessage(playerid,lightblue,str);
Reply
#9

pawn Код:
CMD:setname(playerid,params[])
{
    if(Info[playerid][Level] >= 2 || IsPlayerAdmin(playerid))
    {
        new id, name[24], str[130], newname;
        if(sscanf(params, "udd", id,name,newname)) return SendClientMessage(playerid,red,"/SetName [Playerid/Name] [New Name]");
        GetPlayerName(id,name,24);
        format(str,130,"You Changed %s (%d)'s Name to $%d",name,id,newname);
        SendClientMessage(playerid,lightblue,str);
        format(str,130, "Admin Changed Your Name to $%d",newname);
        SendClientMessage(playerid,lightblue,str);
        SetPlayerName(id,name);
    } else return SendClientMessage(playerid,red,"Your Level Is Not High Enough To Use This Command");
    return 1;
}
Reply
#10

Thanks CyberGhost That works ;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)