25.09.2011, 11:44
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!
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; }