SA-MP Forums Archive
Little bug in my commands - 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)
+--- Thread: Little bug in my commands (/showthread.php?tid=438883)



Little bug in my commands - mickos - 22.05.2013

Hey guys, I have a little bug in my server

When I do any command ingame it says altime that I am in a punishment but I don't.. And it can't be because I didn't add my admin sys in my server for some reasons.

This is one of the commands:

pawn Код:
CMD:kill(playerid, params[])
{
    if(IsCaged[playerid] == 1 || IsJailed[playerid] == 1|| IsFreezed[playerid] == 1)
    {
        SendClientMessage(playerid, -1, ""red"You are currently in your punishment... You must be wait to use any command!");
    }
    SetPlayerHealth(playerid, 0);
    GameTextForPlayer(playerid, "~r~KILLED!",2000,5);
    InMinigame[playerid] = 1;
    IsCaged[playerid] = 1;
    IsJailed[playerid] = 1;
    IsFreezed[playerid] = 1;
    return 1;
}
PHP код:
new IsCaged[MAX_PLAYERS];
new 
IsJailed[MAX_PLAYERS];
new 
IsFreezed[MAX_PLAYERS];
new 
InMinigame[MAX_PLAYERS]; 
So I dont know what I do wrong.. I hope anyone can help me out x)

Thanks


Re: Little bug in my commands - Abhishek. - 22.05.2013

check you named ini file,may be your injailed data is set to 1 if not then post it here


Re: Little bug in my commands - mickos - 22.05.2013

I am not registered at my server, I dont use my admin sys now because it have some bugs.. So I am not jailed or another punishment..

There is nothing wrong with my command?


Re: Little bug in my commands - Abhishek. - 22.05.2013

try
pawn Code:
CMD:kill(playerid, params[])
{
if(IsCaged[playerid] == 1 || IsJailed[playerid] == 1|| IsFreezed[play
{
SendClientMessage(playerid, -1, ""red"You are currently in your p
}
SetPlayerHealth(playerid, 0);
GameTextForPlayer(playerid, "~r~KILLED!",2000,5);
InMinigame[playerid] = 0;
IsCaged[playerid] = 0;
IsJailed[playerid] = 0;
IsFreezed[playerid] = 0;
return 1;
}


Re: Little bug in my commands - Lordzy - 22.05.2013

It's because your Jailed, Cage and such kind of variables are set to 1. Try setting them to 0 under OnPlayerConnect.
pawn Код:
public OnPlayerConnect(playerid)
{
 IsJailed[playerid] = 0;
 IsFreezed[playerid] = 0;
 IsCaged[playerid] = 0;
 IsMinigame[playerid] = 0;
 //Reset your player variables always, then LOAD if registered:
 return 1;
}



Re: Little bug in my commands - Abhishek. - 22.05.2013

he chaged them again and again to 1 in each command ...... I guess