if(strcmp(cmd, "/DelPlayer123", true) == 0) { new tmp[MAX_PLAYER_NAME],str[256]; GetPlayerName(playerid, tmp, sizeof(tmp)); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_GREY, "USAGE: /DelPlayer [Name]"); format(str, sizeof(str), "Users/%s.ini",tmp); if(dini_Exists(tmp)) { SendClientMessage(playerid, COLOR_RED, "The user is not exists"); dini_Remove(tmp); } SendClientMessage(playerid, COLOR_WHITE, "The user has been deleted succedfully"); } } return 1; }
if(strcmp(cmd, "/DelPlayer", true) == 0)
{
new tmp[MAX_PLAYER_NAME],str[256];
GetPlayerName(playerid, tmp, sizeof(tmp));
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_GREY, "USAGE: /DelPlayer [Name]");
format(str, sizeof(str), "Users/%s.ini",tmp);
if(dini_Exists(strval(tmp)))
{
SendClientMessage(playerid, COLOR_WHITE, "The user has been deleted succedfully");
dini_Remove(strval(tmp));
} else return SendClientMessage(playerid, COLOR_RED, "The user is not exists");
return 1;
}
command(deleteplayer, playerid, params[])
{
new Userfile[40]
if(strlen(params) < 1) return SendClientMessage(playerid, 0x0, "The player's name does not seem to be valid");
format(Userfire, sizeof(Userfile), "Users/%s.ini", Params);
if(dini_Exists(Userfile))
{
dini_Remove(Userfile);
SendClientMessage(playerid, COLOR_WHITE, "The user has been deleted succedfully");
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "User does not exist");
}
return 1;
}
C:\Documents and Settings\x\My Documents\samp03\Ultimate.pwn(48195) : warning 219: local variable "tmp" shadows a variable at a preceding level C:\Documents and Settings\x\My Documents\samp03\Ultimate.pwn(48197) : error 047: array sizes do not match, or destination array is too small C:\Documents and Settings\x\My Documents\samp03\Ultimate.pwn(48200) : error 035: argument type mismatch (argument 1) C:\Documents and Settings\x\My Documents\samp03\Ultimate.pwn(48203) : error 035: argument type mismatch (argument 1) Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 3 Errors.
new tmp[MAX_PLAYER_NAME],str[256];
tmp = strtok(cmdtext, idx);
if(dini_Exists(strval(tmp)))
dini_Remove(strval(tmp));
if(!strcmp(cmd, "/DelPalyer", true))
{
new params[24], file[34];
params = strtok(cmdtext, idx);
if(!strlen(params))
{
SendClientMessage(playerid, COLOR_GREY, "USAGE: /DelPlayer [Name]");
}
else
{
format(file, 256, "Users/%s.ini", params);
if(!fexist(file))
{
SendClientMessage(playerid, COLOR_RED, "That user doesn't exist.");
}
else
{
fremove(file);
SendClientMessage(playerid, COLOR_WHITE, "That user has been deleted successfully.");
}
}
return 1;
}
if(strcmp(cmd, "/DelPlayer123", true) == 0)
{
new str[35];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_GREY, "USAGE: /DelPlayer [Name]");
format(str, sizeof(str), "Users/%s.ini",tmp);
if(fremove(str)) SendClientMessage(playerid, COLOR_WHITE, "The user has been deleted succedfully");
else SendClientMessage(playerid, COLOR_RED, "The user is not exists");
return 1;
}
pawn Код:
|
if(strcmp(cmdtext, "/DelPlayer123", true, 13) == 0)
{
new str[35],len;
len = strlen(cmdtext[14]);
if(!len) return SendClientMessage(playerid,COLOR_GREY, "USAGE: /DelPlayer [Name]");
if(!(3 <= len <= 24)) return SendClientMessage(playerid,COLOR_GREY, "Name must be > 3 and < 24 chars");
format(str, sizeof(str), "/Users/%s.ini",cmdtext[14]);
if(fremove(str)) SendClientMessage(playerid, COLOR_WHITE, "The user has been deleted succedfully");
else SendClientMessage(playerid, COLOR_RED, "The user is not exists");
return 1;
}