/setadminname /prison not working check
#1

When i write /setadminname 0 Prince its again repeat /setadmin id name


CMDetadminname(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 5)
{
/*if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 6)
{
SendClientMessage(playerid,COLOR_WHITE, "You're not on-duty as admin. To access your admin commands you must be on-duty. Type /aduty to go on-duty.");
return 1;
}*/

new giveplayerid, name[32];
if(sscanf(params, "us[32]", giveplayerid, name))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setadminname [playerid/partofname] [name]");
return 1;
}

if(PlayerInfo[giveplayerid][pAdmin] < 1)
{
SendClientMessage(playerid, COLOR_WHITE, "The player is not an admin.");
return 1;
}

if(AdminDuty[giveplayerid] != 0)
{
SendClientMessage(playerid, COLOR_WHITE, "That admin is currently on-duty. They must go off-duty in order for you to set their admin name.");
return 1;
}

new length = strlen(name);
if(length < 3 || length > 20)
{
SendClientMessage(playerid, COLOR_WHITE, "The name can't less than 3 characters or more than 20 characters.");
return 1;
}

if(strfind(name, "_", true) != -1)
{
SendClientMessage(playerid, COLOR_WHITE, "The admin name must be one name. There can't be an underscore in the name.");
return 1;
}

if(strcmp(name, "Usama", true) == 0 && PlayerInfo[playerid][pAdmin] < 6) {
SendClientMessage(playerid, COLOR_WHITE, "stop ! im Usama ! you're not Usama !");
return 1;
}

new string[128];
format(string, sizeof(string), "AdmCmd: %s has set %s's admin name to '%s'.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), name);
ABroadCast(COLOR_LIGHTRED, string, 1);

format(PlayerInfo[giveplayerid][pAdminName], 32, name);
}
else SendClientMessage(playerid, COLOR_GRAD1, "You're not authorized to use that command!");
return 1;
}


also this prob with /prison


CMDrison(playerid, params[]) {
if(PlayerInfo[playerid][pAdmin] >= 3) {
if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 6)
return SendClientMessage(playerid,COLOR_WHITE, "You're not on-duty as admin. To access your admin commands you must be on-duty. Type /aduty to go on-duty.");

new string[128], giveplayerid, minutes, reason[64];
if(sscanf(params, "uds[64]", giveplayerid, minutes, reason)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /prison [playerid/partofname] [minutes] [reason]");

if(IsPlayerConnected(giveplayerid))
{
if(PlayerInfo[giveplayerid][pAdmin] >= PlayerInfo[playerid][pAdmin] && AdminDuty[giveplayerid] == 1)
{
SendClientMessage(playerid, COLOR_WHITE, "You can't perform this action on an equal or higher level admin that is on-duty.");
return 1;
}
SetPlayerArmedWeapon(giveplayerid, 0);

/*if(GetPVarInt(giveplayerid, "PBM") > 0)
{
LeavePaintballArena(giveplayerid, GetPVarInt(giveplayerid, "IsInArena"));
}*/

GameTextForPlayer(giveplayerid, "~w~Welcome to ~n~~r~Admin Prison", 5000, 3);

ResetPlayerWeaponsEx(giveplayerid);
format(string, sizeof(string), "AdmCmd: %s has been prisoned by %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
Log("logs/admin.log", string);
format(string, sizeof(string), "AdmCmd: %s has been prisoned by %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
SendClientMessageToAllEx(COLOR_LIGHTRED, string);
PlayerInfo[giveplayerid][pWantedLevel] = 0;
SetPlayerWantedLevel(giveplayerid, 0);
PlayerInfo[giveplayerid][pJailed] = 3;
PlayerInfo[giveplayerid][pJailTime] = minutes*60;
format(PlayerInfo[giveplayerid][pPrisonReason], 128, "%s", reason);
format(PlayerInfo[giveplayerid][pPrisonedBy], MAX_PLAYER_NAME, "%s", GetPlayerNameEx(playerid));
PhoneOnline[giveplayerid] = 1;

TogglePlayerControllable(giveplayerid, 0);
for(new o = 0; o < 6; o++)
{
TextDrawShowForPlayer(giveplayerid, ObjectsLoadingTD[o]);
}
SetPVarInt(giveplayerid, "LoadingObjects", 1);
SetTimerEx("SafeLoadObjects", 3000, 0, "d", giveplayerid);

SetPlayerInterior(giveplayerid, 69);
PlayerInfo[giveplayerid][pVW] = 696969;
PlayerInfo[giveplayerid][pInt] = 69;
SetPlayerVirtualWorld(giveplayerid, 696969);
new rand = random(sizeof(AdminPrisonFloat));
SetPlayerPos(giveplayerid, AdminPrisonFloat[rand][0], AdminPrisonFloat[rand][1], AdminPrisonFloat[rand][2]);

SetPlayerSkin(giveplayerid, 50);
SetPlayerColor(giveplayerid, TEAM_APRISON_COLOR);
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "You're not authorized to use that command!");
}
return 1;
}

also this prob with /oprison idk how many cmd's r bug i donwload HZRP all version also VGRP aall scripts have this bug :/
Reply
#2

Use the
Код HTML:
PHP Code:
Your code inbetween 
Tags to display code, otherwise no one will bother to read
Reply
#3

[PHP] AT START? , AND AT END? [PHP]
Reply
#4

Either
[php][/php]
or
[code][/code]
Reply
#5

It is one opening and one closing tag
Reply
#6

LIKE THIS?
PHP код:
 CMD:makeleader(playeridparams[]) {
    if(
PlayerInfo[playerid][pAdmin] >= 5) {
        if(
AdminDuty[playerid] != && PlayerInfo[playerid][pAdmin] < 6)
            return 
SendClientMessage(playerid,COLOR_WHITE"You're not on-duty as admin. To access your admin commands you must be on-duty. Type /aduty to go on-duty.");

        new 
string[128], giveplayeridfaction;
        if(
sscanf(params"ud"giveplayeridfaction)) {
            
SendClientMessage(playeridCOLOR_WHITE"USAGE: /makeleader [playerid/partofname] [factionid]");
            
SendClientMessage(playeridCOLOR_GRAD3"|1 LSPD |2 FBI |3 LSFMD |4 Hitman |5 Government |9 SA News");
            return 
1;
        }
        
        if(
giveplayerid != INVALID_PLAYER_ID) {
            new
                
ftext[30];
            
            if(
faction == 1)
                
ftext "LSPD";
            else if(
faction == 2)
                
ftext "FBI";
            else if(
faction == 3)
                
ftext "LSFMD";
            else if(
faction == 4)
                
ftext "Hitman Agency";
            else if(
faction == 5)
                
ftext "Government";
            else if(
faction == 9)
                
ftext "SA News";
            else
                return 
SendClientMessage(playeridCOLOR_GREY"Invalid faction ID.");
            
            
PlayerInfo[giveplayerid][pLeader] = faction;
            
PlayerInfo[giveplayerid][pRank] = 6;
            
PlayerInfo[giveplayerid][pFaction] = faction;

            
format(stringsizeof(string), "You have been made the leader of the %s by Admin %s.",ftextGetPlayerNameEx(playerid));
            
SendClientMessage(giveplayeridCOLOR_LIGHTBLUEstring);
            
format(stringsizeof(string), "%s have made %s the leader of the %s."GetPlayerNameEx(playerid), GetPlayerNameEx(playerid), ftext);
            
Log("logs/faction.log"string);
            
format(stringsizeof(string), "You have made %s the leader of the %s."GetPlayerNameEx(giveplayerid),ftext);
            
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
            
PlayerInfo[giveplayerid][pGang] = 255;
        }
    }
    else
    {
        
SendClientMessage(playeridCOLOR_GRAD1"You're not authorized to use that command!");
    }
    return 
1;

Reply
#7

HOWI ADD IT ON GAMEMOD TELL ME THAT
Reply
#8

Add what? The command? Just copy paste it and make the neccessary changed, we can't we dont know your gamemode.
Reply
#9

its hzrp
Reply
#10

i don't know it and i won't bother downloading it, if you want to script, either start learning it or hire a scripter (thats just my opinion ) , but don't ask questions like "how do i add something"
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)