30.10.2010, 17:34
this is my command:
it does uninvite me, though when i relog i'm back in the faction... why?
pawn Код:
if(strcmp(cmd,"/uninvite",true)==0)
{
new string1[256];
new playaname[24];
new playa[126];
playa = strtokk(cmdtext, idx);
GetPlayerName(strval(playa), playaname, sizeof(playaname));
new pfile1[128];
format(pfile,sizeof(pfile),"user/%s.ini",playaname);
if(PlayerInfo[playerid][pLeader] == 1)
{
if(!strlen(playa))
{
SendClientMessage(playerid,color_white,"USE: /uninvite [playerid]");
return 1;
}
if(strval(playa) != INVALID_PLAYER_ID)
{
if(IsPlayerConnected(strval(playa)))
{
PlayerInfo[strval(playa)][pLFaction] = 0;
PlayerInfo[strval(playa)][pLRank] = 0;
dini_Set(pfile1, "LFaction", PlayerInfo[strval(playa)][pLRank]);
dini_Set(pfile1, "Rank", PlayerInfo[strval(playa)][pLFaction]);
format(string, sizeof(string), "The leader %s [%d] kicked you from his faction",playername,playerid);
SendClientMessage(strval(playa),color_white,string);
format(string, sizeof(string), "You uninvite id %d from your faction",strval(playa));
SendClientMessage(playerid,color_white,string1);
return 1;
}
else if(!IsPlayerConnected(strval(playa)))
{
SendClientMessage(playerid,color_red,"This player isn't connected!");
return 1;
}
}
else if(strval(playa) == INVALID_PLAYER_ID)
{
SendClientMessage(playerid,color_red,"This is an Invlid player id");
return 1;
}
}
else if(PlayerInfo[playerid][pLeader] == 0)
{
SendClientMessage(playerid,color_red,"You aren't a leader");
return 1;
}
}