Hey, i have an rp-faction uninvite problem - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Hey, i have an rp-faction uninvite problem (
/showthread.php?tid=186742)
Hey, i have an rp-faction uninvite problem -
sbulletin - 30.10.2010
this is my command:
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;
}
}
it does uninvite me, though when i relog i'm back in the faction... why?
Re: Hey, i have an rp-faction uninvite problem -
Mike_Peterson - 30.10.2010
i see you got the dini's turned around:
Код:
dini_Set(pfile1, "LFaction", PlayerInfo[strval(playa)][pLRank]);
dini_Set(pfile1, "Rank", PlayerInfo[strval(playa)][pLFaction]);
must be:
Код:
dini_Set(pfile1, "Rank", PlayerInfo[strval(playa)][pLRank]);
dini_Set(pfile1, "LFaction", PlayerInfo[strval(playa)][pLFaction]);
and this:
Код:
playa = strtokk(cmdtext, idx);
must be:
Код:
playa = strtok(cmdtext, idx);
and try using sscanf..
Re: Hey, i have an rp-faction uninvite problem -
sbulletin - 30.10.2010
Well, you can't know that the problem is in the variable of "pfaction" and "plrank" because you didn't see the definition of this variable. The problem was in the definition of pfile. I wrote "new pfile1" and I did the format for "pfile".