Request :)
#1

I have this CMD
Quote:

if(strcmp(cmd, "/pk", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /pk [id/name] [PKer]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 3)
{
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /pk [id/name] [PKer]");
return 1;
}
format(string, sizeof(string), "[AdminCMD] : %s Was AdminPKed by Admin %s - PKer: %s", giveplayer, sendername, (result));
SendClientMessageToAll(0x5EFB6EFF, string);
format(string, sizeof(string), "You were AdminPKed by Admin %s, you are kicked out of your faction.",sendername);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
return 1;
}
}
}
else
{
format(string, sizeof(string), " %d is not an active player.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}

Nobody answers the GF or the Scripting request thread.
Thanks in advance
Regards-FreeSoul
Reply
#2

Yes? That is a command. What do you need help with ?
Reply
#3

Lol
I forgot about that.
I need it so,if the player gets Pked he will be kicked out of his faction.
Reply
#4

I don't use the GodFather script much at all, but I do remember something. You need to find the decleration of a playerInfo array (or something of the sort). Then just find the part that defines the faction or team they are in and set that back to civilian.
Reply
#5

Tried,failed badly.
I tried to copy the thing from the /uninvite command,unfortunately it doesn't work.It just sets his skin to a civilian ,but he has the same spawn,skins,and CMDS of the faction
Reply
#6

Quote:
Originally Posted by FreeSoul
Lol
I forgot about that.
I need it so,if the player gets Pked he will be kicked out of his faction.
So what are you using to define the teams? SetPlayerTeam?
Reply
#7

where is the current faction of the player being stored? i.e. AccountInfo[playerid][faction] ??
Reply
#8

I think this is it.

Quote:

if (PlayerInfo[playerid][pMember] == 18 || PlayerInfo[playerid][pLeader] == 1
Reply
#9

pawn Код:
if(strcmp(cmd, "/pk", true) == 0)
    {
      if(IsPlayerConnected(playerid))
      {
        tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /pk [id/name] [PKer]");
                return 1;
            }
            giveplayerid = ReturnUser(tmp);
            if (PlayerInfo[playerid][pAdmin] >= 3)
            {
                if(IsPlayerConnected(giveplayerid))
                {
                  if(giveplayerid != INVALID_PLAYER_ID)
                  {
                      GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        new length = strlen(cmdtext);
                        while ((idx < length) && (cmdtext[idx] <= ' '))
                        {
                            idx++;
                        }
                        new offset = idx;
                        new result[64];
                        while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
                        {
                            result[idx - offset] = cmdtext[idx];
                            idx++;
                        }
                        result[idx - offset] = EOS;
                        if(!strlen(result))
                        {
                            SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /pk [id/name] [PKer]");
                            return 1;
                        }
                    format(string, sizeof(string), "[AdminCMD] : %s Was AdminPKed by Admin %s - PKer: %s", giveplayer, sendername, (result));
                   SendClientMessageToAll(0x5EFB6EFF, string);
                   format(string, sizeof(string), "You were AdminPKed by Admin %s, you are kicked out of your faction.",sendername);
                   PlayerInfo[giveplayerid][pMember]=0;
                   PlayerInfo[giveplayerid][pLeader]=0;
                   SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
                        return 1;
                    }
                }
            }
            else
            {
                format(string, sizeof(string), " %d is not an active player.", giveplayerid);
                SendClientMessage(playerid, COLOR_GRAD1, string);
            }
        }
        return 1;
    }
Try this,i`m not test this...You just must little indentation
Reply
#10

Doesn't work..
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)