#1

givetag command work nice when i do him its make player name with tag [Lsgw]

but when i do /taketag its not take from player [Lsgw] tag how help!


Код:
	if(strcmp(cmd, "/givetag", true) == 0 && PlayerAdminLevel[playerid] >= 1) // Gives a player army
	{
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp)) {
    SendClientMessage(playerid, COLOR_ERROR, "USAGE: /givetag (id)");
    return 1;
    }
    if(!IsNumeric(tmp)) {
    SendClientMessage(playerid, COLOR_ERROR, "USAGE: /givetag (id) ID Must be a number");
    return 1;
    }
    giveplayerid = strval(tmp);
    if(!IsPlayerConnected(giveplayerid)) {
    format(string, sizeof(string), "ID (%d) is not an active player", giveplayerid);
    SendClientMessage(playerid, COLOR_ERROR, string);
    return 1;
    }
    if(CanUseTag[giveplayerid] == 1){
    format(string, sizeof(string), "ID (%d) is already got tag", giveplayerid);
    SendClientMessage(playerid, COLOR_ERROR, string);
    return 1;
    }
    new sendername[24];
    new receivername[24];
    GetPlayerName(playerid,sendername, 24);
    GetPlayerName(giveplayerid,receivername, 24);
	format(string, sizeof(string), "You Have Give %s(%d) [Lsgw] Tag Right",receivername,giveplayerid);
    SendClientMessage(playerid, COLOR_GREEN, string);
	format(string, sizeof(string), "Tag Right Has Been Given For You By Server %s! Have Fun! Read /rules, /pc",AdminRanks[PlayerAdminLevel[playerid]]);
    SendClientMessage(giveplayerid, COLOR_GREEN, string);
    format(string, sizeof(string), "Server %s %s(%d) Has Give %s(%d) [Lsgw] Tag Right",AdminRanks[PlayerAdminLevel[playerid]],sendername,playerid,receivername,giveplayerid);
    printf("%s",string);
    dUserSetINT(PlayerName(giveplayerid)).("canusetag",1);
    CanUseTag[giveplayerid] =1;
    new namestr[128];
    format(namestr,sizeof(namestr),"[Lsgw]%s",receivername);
    SetPlayerName(giveplayerid,namestr);
	return 1;
	}


	///////////////////////////

	if(strcmp(cmd, "/taketag", true) == 0 && PlayerAdminLevel[playerid] >= 1) // Gives a player army
	{
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp)) {
    SendClientMessage(playerid, COLOR_ERROR, "USAGE: /taketag (id)");
    return 1;
    }
    if(!IsNumeric(tmp)) {
    SendClientMessage(playerid, COLOR_ERROR, "USAGE: /taketag (id) ID Must be a number");
    return 1;
    }
    giveplayerid = strval(tmp);
    if(!IsPlayerConnected(giveplayerid)) {
    format(string, sizeof(string), "ID (%d) is not an active player", giveplayerid);
    SendClientMessage(playerid, COLOR_ERROR, string);
    return 1;
    }
    if(CanUseTag[giveplayerid] == 0){
    format(string, sizeof(string), "ID (%d) is already cant use tag", giveplayerid);
    SendClientMessage(playerid, COLOR_ERROR, string);
    return 1;
    }
    new sendername[24];
    new receivername[24];
    GetPlayerName(playerid,sendername, 24);
    GetPlayerName(giveplayerid,receivername, 24);
	format(string, sizeof(string), "You Have Taked %s(%d) [Lsgw] Tag Right",receivername,giveplayerid);
    SendClientMessage(playerid, COLOR_GREEN, string);
	format(string, sizeof(string), "Tag Right Has Been Taked Down Form You By Server %s!",AdminRanks[PlayerAdminLevel[playerid]]);
    SendClientMessage(giveplayerid, COLOR_GREEN, string);
    format(string, sizeof(string), "Server %s %s(%d) Has Taked %s(%d) [Lsgw] Tag Right",AdminRanks[PlayerAdminLevel[playerid]],sendername,playerid,receivername,giveplayerid);
    printf("%s",string);
    dUserSetINT(PlayerName(giveplayerid)).("canusetag",0);
    CanUseTag[giveplayerid] =0;
    new namestr[128];
    format(namestr,sizeof(namestr),"%s",receivername);
    SetPlayerName(giveplayerid,namestr);
	return 1;
	}
Reply
#2

your code is very difficult to read, but at a glance, it seems like you are not actually changing the players name in your /taketag command.

you might have to use strmid to remove the [stuff] from the players name.
Reply
#3

I did like this

strmid(namestr,"[Lsrcr]",1,7);

the result is like this check oout!

http://imageshack.us/photo/my-images/18/samp019bu.png/
Reply
#4


Of course, strmid takes that particular part out of the string and deletes everything else. Use strdel.
Reply
#5

yea and how i can use strdel! help me man



Код:
if(strcmp(cmd, "/taketag", true) == 0 && PlayerAdminLevel[playerid] >= 1) // Gives a player army
	{
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp)) {
    SendClientMessage(playerid, COLOR_ERROR, "USAGE: /taketag (id)");
    return 1;
    }
    if(!IsNumeric(tmp)) {
    SendClientMessage(playerid, COLOR_ERROR, "USAGE: /taketag (id) ID Must be a number");
    return 1;
    }
    giveplayerid = strval(tmp);
    if(!IsPlayerConnected(giveplayerid)) {
    format(string, sizeof(string), "ID (%d) is not an active player", giveplayerid);
    SendClientMessage(playerid, COLOR_ERROR, string);
    return 1;
    }
    if(CanUseTag[giveplayerid] == 0){
    format(string, sizeof(string), "ID (%d) is already cant use tag", giveplayerid);
    SendClientMessage(playerid, COLOR_ERROR, string);
    return 1;
    }
    new sendername[24];
    new receivername[24];
    GetPlayerName(playerid,sendername, 24);
    GetPlayerName(giveplayerid,receivername, 24);
	format(string, sizeof(string), "You Have Taked %s(%d) [Lsrcr] Tag Right",receivername,giveplayerid);
    SendClientMessage(playerid, COLOR_GREEN, string);
	format(string, sizeof(string), "Tag Right Has Been Taked Down Form You By Server %s!",AdminRanks[PlayerAdminLevel[playerid]]);
    SendClientMessage(giveplayerid, COLOR_GREEN, string);
    format(string, sizeof(string), "Server %s %s(%d) Has Taked %s(%d) [Lsrcr] Tag Right",AdminRanks[PlayerAdminLevel[playerid]],sendername,playerid,receivername,giveplayerid);
    printf("%s",string);
    dUserSetINT(PlayerName(giveplayerid)).("canusetag",0);
    CanUseTag[giveplayerid] =0;
    new namestr[128];
    format(namestr,sizeof(namestr),"%s",receivername);
    SetPlayerName(giveplayerid,namestr);
	return 1;
	}
Reply
#6

my name ingame is

[Lsgw]Max how i can remove [Lsgw] when i type /taketag please help!!!!
Reply
#7

is there anyone know OMG! please help
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)