CMD:aname?
#1

I'm trying to make /aname command, but keeps on getting errors, These are my codes:

Код:
C:\Users\Desktop\PR RP SCRIPT NEW\filterscripts\aname.pwn(23) : error 017: undefined symbol "aDuty"
C:\Users\Desktop\PR RP SCRIPT NEW\filterscripts\aname.pwn(23) : warning 215: expression has no effect
C:\Users\Desktop\PR RP SCRIPT NEW\filterscripts\aname.pwn(23) : error 001: expected token: ";", but found "]"
C:\Users\Desktop\PR RP SCRIPT NEW\filterscripts\aname.pwn(23) : error 029: invalid expression, assumed zero
C:\Users\Desktop\PR RP SCRIPT NEW\filterscripts\aname.pwn(23) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
This is my code

Код:
#include <a_samp>
#include <zcmd>
#include <sscanf2>
#include <dini>
#pragma tabsize 0


#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_GREY 0xAFAFAFAA

new IsPlayerLoggedIn[MAX_PLAYERS]; 

enum pInfo {
pAdmin
};
new PlayerInfo[MAX_PLAYERS][pInfo];

CMD:aname(playerid, params[])
{
	new string[128], file[32], text[MAX_PLAYER_NAME];
	if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
	if(sscanf(params, "s[24]", text)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /aname [name]");
	if(aDuty[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You must be off duty to change your admin name.");
	// Start of detecting space in name
	new end, temp[32], temp2[32];
	end = strfind(text, " ",true);
	if(end != -1)
	{
	    strmid(temp, text, 0, end);
	    format(temp, sizeof(temp), "%s_", temp);
	    strdel(text, 0, end);
		strmid(temp2, text, 1, strlen(text));
	    format(text, 24, "");
	    strcat(text, temp, sizeof(temp));
	    strcat(text, temp2, sizeof(temp2));
	}
	// End of detecting space in name
	format(file, sizeof(file), "users/%s.ini", text);
	if(dini_Exists(file))
	{
	    format(file, sizeof(file), "users/%s.ini", RPNU(playerid));
	    if(strlen(dini_Get(file, "AdminName")) && strcmp(dini_Get(file, "AdminName"), text))
	    {
	     	SendClientMessage(playerid, COLOR_GREY, "Name is already in use.");
	        return 1;
	    }
	}
	format(string, sizeof(string), " You have changed your admin name to: {FF6347}%s", text);
	SendClientMessage(playerid, COLOR_WHITE, string);
	format(string, sizeof(string), "%s has changed their admin name to %s.", RPN(playerid), text);
	Log("logs/aname.log", string);
	format(file, sizeof(file), "users/%s.ini", RPNU(playerid));
	format(file, sizeof(file), "users/%s.ini", dini_Get(file, "AdminName"));
	if(dini_Exists(file)) dini_Remove(file);
	format(file, sizeof(file), "users/%s.ini", RPNU(playerid));
	dini_Set(file, "AdminName", text);
	format(file, sizeof(file), "users/%s.ini",dini_Get(file, "AdminName"));
	dini_Create(file);
	dini_Set(file, "OldName", RPNU(playerid));
	dini_IntSet(file, "Admin", PlayerInfo[playerid][pAdmin]);
	dini_IntSet(file, "AdminAccount", 1);
	dini_IntSet(file, "Age", 25);
	dini_IntSet(file, "Gender", 1);
	dini_IntSet(file, "Tutorial", 1);
	dini_Set(file, "IP", PlayerInfo[playerid][pIP]);
	return 1;
}
Reply


Messages In This Thread
CMD:aname? - by DGRP - 23.08.2015, 12:04
Re: CMD:aname? - by thaKing - 23.08.2015, 12:07
Re : Re: CMD:aname? - by DGRP - 23.08.2015, 12:15
Re: CMD:aname? - by Fancy - 23.08.2015, 12:27
Re: CMD:aname? - by thaKing - 23.08.2015, 12:27
Re : Re: CMD:aname? - by DGRP - 23.08.2015, 12:33
Re : Re: CMD:aname? - by DGRP - 23.08.2015, 12:37
Re: CMD:aname? - by thaKing - 23.08.2015, 12:38
Re : Re: CMD:aname? - by DGRP - 23.08.2015, 12:50
Re: CMD:aname? - by Infinity - 25.08.2015, 17:27

Forum Jump:


Users browsing this thread: 1 Guest(s)