Cmds freeze / unfreeze dont work anymore ??
#1

Yeah, idk how it possible ? When i start my server for the first time and later ... but now it don't work anymore.
First the server says: SERVER: unknown cmd or second: nothing happen ...

Here is the pawn code:
pawn Код:
if(strcmp("/freeze", cmdtext, true) == 0)
    {
        if(IsPlayerAdmin(playerid))
        {
            if(!strlen(cmdtext[8])) return SendClientMessage(playerid, 0xFF0000AA, "Use: /freeze [playerid]");
            new gp = strval(cmdtext[8]);
            if(!IsPlayerConnected(gp)) return SendClientMessage(playerid, 0xFF0000AA, "Invalid Playerid");
            new pn[24], an[24], str[70];
            GetPlayerName(playerid, an, 24); GetPlayerName(gp, pn, 24);
            format(str, sizeof(str), "%s is frozen by admin %s", pn, an);
            SendClientMessageToAll(0xA9A9A9AA, str);
            TogglePlayerControllable(gp, 0);
            return 1;
        }
    }
   
    if(strcmp("/unfreeze", cmdtext, true) == 0)
    {
        if(IsPlayerAdmin(playerid))
        {
            if(!strlen(cmdtext[10])) return SendClientMessage(playerid, 0xFF0000AA, "Use: /unfreeze [playerid]");
            new gp = strval(cmdtext[10]);
            if(!IsPlayerConnected(gp)) return SendClientMessage(playerid, 0xFF0000AA, "Invalid Playerid");
            new pn[24], an[24], str[70];
            GetPlayerName(playerid, an, 24); GetPlayerName(gp, pn, 24);
            format(str, sizeof(str), "%s is unfrozen by admin %s", pn, an);
            SendClientMessageToAll(0xA9A9A9AA, str);
            TogglePlayerControllable(gp, 1);
            return 1;
        }
    }
AAAA I GIVE IT UP DUDE ! Stupid server, samp ... things xD
Reply
#2

/rcon login rconpassword
Reply
#3

Quote:
Originally Posted by veyron
Посмотреть сообщение
rcon login rconpassword
Yeah, i do that ! It's not working ....
Reply
#4

code seems fine, something else must be wrong
Reply
#5

Quote:
Originally Posted by veyron
Посмотреть сообщение
code seems fine, something else must be wrong
Yeah, idk what ... It can't be a bug ?! No because, it worked last time.... Maybe ... FUCK IT !WHY IT DOESNT WORK
-> If i type "/freeze" it says "Use: /freeze [playerid]" -> Thats working but if i do (for example) "/freeze 2" ... nothing happen or the server says "Server: unknown cmd"

BTW, i have filtercripts with cmds, but that could not be the problem ... or it is ?!
Reply
#6

Hey michael

Every other commands work ? for player/admin ?
Reply
#7

Quote:
Originally Posted by gereter
Посмотреть сообщение
Hey michael

Every other commands work ? for player/admin ?
Hello xp

Well, everything works ... except those 2 cmds <_< idk what to do ...
( Admin cmd: /rcon say blablah -> works !)
( Player cmd: /info /rules ... -> works !)
Reply
#8

Try:
pawn Код:
COMMAND:freeze(playerid, params[])
{
    new name[MAX_PLAYER_NAME], ID, frozen[50];
   
    if(IsPlayerAdmin(playerid))
    {
        if(sscanf(params, "u", ID)) SendClientMessage(playerid, 0xE60000FF, "USAGE: /spec [ID]");
            else if(ID == INVALID_PLAYER_ID) SendClientMessage(playerid, 0xE60000FF, "Player is not connected!");
                else
                {
                    GetPlayerName(ID, name, sizeof(name));
                    format(frozen, sizeof(frozen), "[SERVER]: %s has been frozen.", name);
                    TogglePlayerControllable(ID, 0);
                    SendClientMessageToAll(RED, frozen);
                }
    }
    else return 0;
    return 1;
}
Using: ZCMD and sscanf
EDIT: Just tested and it works, if you have problems it may be because of something else in your code.
Reply
#9

ok i hope it works, but i dont have those ZCMD and sscanf. Can you give me a link for download!?
Reply
#10

off topic (kinda): usually when you use ZCMD with strcmp commands only the ZCMD commands will work

on topic:
Try this

pawn Код:
if(strcmp("/freeze", cmdtext, true) == 0)
    {
        if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000AA, "You Must Be Logged Into RCON To Use This Command!");
            if(!strlen(cmdtext[8])) return SendClientMessage(playerid, 0xFF0000AA, "Use: /freeze [playerid]");
            new gp = strval(cmdtext[8]);
            if(!IsPlayerConnected(gp)) return SendClientMessage(playerid, 0xFF0000AA, "Invalid Playerid");
            new pn[24], an[24], str[70];
            GetPlayerName(playerid, an, 24); GetPlayerName(gp, pn, 24);
            format(str, sizeof(str), "%s is frozen by admin %s", pn, an);
            SendClientMessageToAll(0xA9A9A9AA, str);
            TogglePlayerControllable(gp, 0);
            return 1;
        }
   
    if(strcmp("/unfreeze", cmdtext, true) == 0)
    {
        if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000AA, "You Must Be Logged Into RCON To Use This Command!");
            if(!strlen(cmdtext[10])) return SendClientMessage(playerid, 0xFF0000AA, "Use: /unfreeze [playerid]");
            new gp = strval(cmdtext[10]);
            if(!IsPlayerConnected(gp)) return SendClientMessage(playerid, 0xFF0000AA, "Invalid Playerid");
            new pn[24], an[24], str[70];
            GetPlayerName(playerid, an, 24); GetPlayerName(gp, pn, 24);
            format(str, sizeof(str), "%s is unfrozen by admin %s", pn, an);
            SendClientMessageToAll(0xA9A9A9AA, str);
            TogglePlayerControllable(gp, 1);
            return 1;
        }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)