18.10.2010, 14:05
mudar nick:
Deletar conta
Espero ter ajudado
pawn Код:
if(strcmp(cmd,"/mudarnick",true)==0)
{
if(IsPlayerConnected(playerid))
{
new x_Nick[256];
new mplayername[MAX_PLAYER_NAME];
new carnick[MAX_PLAYERS];
x_Nick = strtok(cmdtext, idx);
if(!strlen(x_Nick))
{
SendClientMessage(playerid, COLOR_WHITE, "USE: /mudarnick [nome]");
return 1;
}
format(string, sizeof(string), "%s.ini", x_Nick);
if(fexist(string))
{
SendClientMessage(playerid, COLOR_GREY,"Este nick ja estб sendo usado!");
return 1;
}
if(mudandonick == 1)
{
SendClientMessage(playerid, COLOR_GREY,"Tente novamente mais tarde!");
return 1;
}
mudandonick = 1;
GetPlayerName(playerid,mplayername,sizeof(mplayername));
format(string, sizeof(string), "%s.ini", mplayername);
if(fexist(string))
{
GetPlayerName(playerid,mplayername,sizeof(mplayername));
format(string, sizeof(string), "%s.ini", mplayername);
fremove(string);
}
for(new i = 0; i < sizeof(BizzInfo); i++)
{
GetPlayerName(playerid,mplayername,sizeof(mplayername));
if(strcmp(mplayername,BizzInfo[i][bOwner],true)==0)
{
strmid(BizzInfo[i][bOwner], x_Nick, 0, strlen(x_Nick), 255);
}
}
for(new i = 0; i < sizeof(SBizzInfo); i++)
{
GetPlayerName(playerid,mplayername,sizeof(mplayername));
if(strcmp(mplayername,SBizzInfo[i][sbOwner],true)==0)
{
strmid(SBizzInfo[i][sbOwner], x_Nick, 0, strlen(x_Nick), 255);
}
}
for(new h = 0; h < sizeof(HouseInfo); h++)
{
GetPlayerName(playerid,mplayername,sizeof(mplayername));
if(strcmp(mplayername,HouseInfo[h][hOwner],true)==0)
{
strmid(HouseInfo[h][hOwner], x_Nick, 0, strlen(x_Nick), 255);
}
}
for(new i = 0; i < sizeof(AdminInfo); i++)
{
GetPlayerName(playerid,mplayername,sizeof(mplayername));
if(strcmp(mplayername,AdminInfo[i][AdminNick],true)==0)
{
strmid(AdminInfo[i][AdminNick], x_Nick, 0, strlen(x_Nick), 999);
}
}
if(PlayerInfo[playerid][pVIP] > 2)
{
for(new i = 0; i < sizeof(VipInfo); i++)
{
if(PlayerInfo[playerid][vipID] == VipInfo[i][vID])
{
strmid(VipInfo[i][VipNick], x_Nick, 0, strlen(x_Nick), 999);
}
}
for(new c = 0; c < sizeof(CarInfo); c++)
{
if(PlayerInfo[playerid][pCarKey] == CarInfo[c][cID])
{
strmid(CarInfo[c][cOwner], x_Nick, 0, strlen(x_Nick), 999);
}
}
}
GetPlayerName(playerid,playername,sizeof(playername));
new year, month,day;
getdate(year, month, day);
new hour, minute;
gettime(hour,minute);
format(string, sizeof(string), "%s Mudou o Nick para %s ( %d/%d/%d - %d:%d)",playername,x_Nick, year, month, day,hour, minute);
ABroadCast(COLOR_YELLOW,string,1);
NickLog(string);
format(string, sizeof(string), "%s",x_Nick );
SetPlayerName(playerid,string);
format(string, sizeof(string), "Vocк mudou seu nick para %s",x_Nick );
SendClientMessage(playerid, COLOR_GREY, string);
SendClientMessage(playerid, COLOR_GREY, "Tire uma SS para nгo esquecer o novo nick!");
SendClientMessage(playerid, COLOR_GREY, "Pressione F8");
SendClientMessage(playerid, COLOR_GREY, "Obrigado por usar o Poderoso Sistema de Nick");
OnPlayerUpdate(playerid);
OnPropUpdate();
SaveAdmin();
SaveCars();
SaveVip();
mudandonick = 0;
carnick[playerid] = 0;
return 1;
}
Deletar conta
pawn Код:
if (strcmp(cmd, "/deletarconta", true)==0)
{
if ((IsPlayerAdmin(playerid)) || PlayerInfo[playerid][pAdmin] >= 1337)
{
if(admtrampando[playerid] < 1)
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/trabalhar)");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USE: /deletarconta [PlayerName]");
return 1;
}
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
//format(string, 256, "ADM: %s desbaniu %s", sendername,tmp);
ABroadCast(COLOR_YELLOW,string,1);
format(string, 256, "ADM: %s deletou a conta %s", sendername,tmp);
printf(string);
format(string,sizeof(string),"%s.ini",tmp);
fremove(string);
SendClientMessage(playerid, COLOR_GRAD1, "Jogador desbanido");
}
return 1;
}*/