I need someone who can help me make the /lspddiv command, i have this old code i don't know if it still works,please help me
Код:
if(strcmp(cmd, "/lspddiv", true) == 0)
{
if(IsACop(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /lspddiv [playerid/PartOfName] [divisionname]");
SendClientMessage(playerid, COLOR_GRAD2, "Available division names: siu, swat, none");
return 1;
}
}
new para1;
para1 = ReturnUser(tmp);
if (PlayerInfo[playerid][pRank] >= 5)
{
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
new division[32];
division = strtok(cmdtext, idx);
if(!strlen(division))
{
if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /lspddiv [playerid/PartOfName] [divisionname]");
SendClientMessage(playerid, COLOR_GRAD2, "Available division names: 0 (ALL), 1 (None), 2 (SWAT), 3 (SIU)");
return 1;
}
}
if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
{
if(strcmp(division, "3", true) == 0)
{
if (PlayerInfo[para1][pMember] == 1)
{
PlayerInfo[para1][pDivision] = 3;
format(string, sizeof(string), " You have been invited to the SIU Division by %s.", GetPlayerNameEx(playerid));
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), " You have invited %s to join the SIU Division.", GetPlayerNameEx(para1));
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
}
else if(strcmp(division, "2", true) == 0)
{
if (PlayerInfo[para1][pMember] == 1)
{
PlayerInfo[para1][pDivision] = 2;
format(string, sizeof(string), " You have been invited to the SWAT Division by %s.", GetPlayerNameEx(playerid));
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), " You have invited %s to join the SWAT Division.", GetPlayerNameEx(para1));
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
}
else if(strcmp(division, "0", true) == 0)
{
if (PlayerInfo[para1][pMember] == 1)
{
PlayerInfo[para1][pDivision] = OH EM GEE I NEED TO MAKE IT SO "0" HAS ACCESS TO ALL THE DIVS;
format(string, sizeof(string), " You now have access to all divisions by %s.", GetPlayerNameEx(playerid));
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), " You have given access to all divisions to %s.", GetPlayerNameEx(para1));
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
}
else if(strcmp(division, "1", true) == 0)
{
if (PlayerInfo[para1][pMember] == 1)
{
PlayerInfo[para1][pDivision] = 1;
format(string, sizeof(string), " You have been kicked from your division by %s.", GetPlayerNameEx(playerid));
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), " You have kicked %s out of his division.", GetPlayerNameEx(para1));
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
}
}
}
}//not connected
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "You are not authorized to use that command (leaders only)!");
}
}
return 1;
}