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.
#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; }
new bool: aDuty[MAX_PLAYERS];
Under new IsPlayerLoggedIn[MAX_PLAYERS]; add
PHP код:
|
C:\Users\Rizal\Desktop\PR RP SCRIPT NEW\filterscripts\aname.pwn(42) : error 017: undefined symbol "RPNU" C:\Users\Rizal\Desktop\PR RP SCRIPT NEW\filterscripts\aname.pwn(51) : error 017: undefined symbol "RPN" C:\Users\Rizal\Desktop\PR RP SCRIPT NEW\filterscripts\aname.pwn(52) : error 017: undefined symbol "Log" C:\Users\Rizal\Desktop\PR RP SCRIPT NEW\filterscripts\aname.pwn(53) : error 017: undefined symbol "RPNU" C:\Users\Rizal\Desktop\PR RP SCRIPT NEW\filterscripts\aname.pwn(56) : error 017: undefined symbol "RPNU" C:\Users\Rizal\Desktop\PR RP SCRIPT NEW\filterscripts\aname.pwn(60) : error 017: undefined symbol "RPNU" C:\Users\Rizal\Desktop\PR RP SCRIPT NEW\filterscripts\aname.pwn(66) : error 017: undefined symbol "pIP" C:\Users\Rizal\Desktop\PR RP SCRIPT NEW\filterscripts\aname.pwn(69) : warning 203: symbol is never used: "IsPlayerLoggedIn" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
#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]; new aDuty[MAX_PLAYERS]; 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; }
#include <a_samp>
#include <zcmd>
#include <sscanf2>
#include <dini>
#pragma tabsize 0
#define COLOR_WHITE (0xFFFFFFAA)
#define COLOR_GREY (0xAFAFAFAA)
enum pInfo {
pAdmin
};
new PlayerInfo[MAX_PLAYERS][pInfo];
new bool: aDuty[MAX_PLAYERS];
PlayerName(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
return name;
}
ReturnIP(playerid)
{
static
ip[16];
GetPlayerIp(playerid, ip, sizeof(ip));
return ip;
}
CMD:aduty(playerid, params[])
{
if (PlayerInfo[playerid][pAdmin] < 1)
return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
if (!aDuty[playerid]) {
SendClientMessage(playerid, -1, "You are now in adminduty!");
aDuty[playerid] = true;
} else {
SendClientMessage(playerid, -1, "You are no longer adminduty!");
aDuty[playerid] = false;
}
return 1;
}
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", PlayerName(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(file, sizeof(file), "users/%s.ini", PlayerName(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", PlayerName(playerid));
dini_Set(file, "AdminName", text);
format(file, sizeof(file), "users/%s.ini",dini_Get(file, "AdminName"));
dini_Create(file);
dini_Set(file, "OldName", PlayerName(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", ReturnIP(playerid));
return 1;
}
Try this:
Код:
#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]; new aDuty[MAX_PLAYERS]; 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; } |
PHP код:
|
yes, it is, just delete cmd:aduty
I mean whole command, not only cmd:aduty(playerid, params[]) |