Tag mismatch.. (HELP BUG.)
#1

pawn Код:
CMD:superid(playerid, params[])
// This is a comment
// uncomment the line below if you want to write a filterscript
#define FILTERSCRIPT

#include <a_samp>
#include <zcmd>

new bool:superidof[MAX_PLAYERS] = false;

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Blank Filterscript by your name here");
    print("--------------------------------------\n");
    return 1;
}

public OnPlayerConnect()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        superidof[i] = false;
    }
    return 1;
}

public OnPlayerDisconnect()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        superidof[i] = false;
    }
    return 1;
}

public OnPlayerSpawn(playerid)
{
   superidof[playerid] = false;
   return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

CMD:superid(playerid, params[])
{
    new str[256], Float:Pos[4], PlayerText3D:label;
    if(superidof[playerid] == false)
    {
        superidof[playerid] = true;
        SendClientMessage(playerid, 0xFF4435FF, "You've turned ON the Superid!");
       
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            GetPlayerPos(i, Pos[1], Pos[2], Pos[3]);
            i = playerid;
            format(str, 256, "ID: %i", i);
            CreatePlayer3DTextLabel(i, str, 0xFF6642FF, Pos[1], Pos[2], Pos[3], 200.0, -1, 1);
        }
    }
    if(superidof[playerid] == true)
    {
        superidof[playerid] = false;
        SendClientMessage(playerid, 0xFF4435FF, "You've turned OFF the Superid!");
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            DeletePlayer3DTextLabel(i, label);
        }
    }
    return 1;
}
       

}
When i turn it on, i can't use any command like the server freezes or smthing, whys so?
Reply
#2

PHP код:
CMD:superid(playeridparams[])
// This is a comment
// uncomment the line below if you want to write a filterscript
#define FILTERSCRIPT
#include <a_samp>
#include <zcmd>
new bool:superidof[MAX_PLAYERS] = false;
public 
OnFilterScriptInit()
{
    print(
"\n--------------------------------------");
    print(
" Blank Filterscript by your name here");
    print(
"--------------------------------------\n");
    return 
1;
}
public 
OnPlayerConnect()
{
    for(new 
0MAX_PLAYERSi++)
    {
        
superidof[i] = false;
    }
    return 
1;
}
public 
OnPlayerDisconnect()
{
    for(new 
0MAX_PLAYERSi++)
    {
        
superidof[i] = false;
    }
    return 
1;
}
public 
OnPlayerSpawn(playerid)
{
   
superidof[playerid] = false;
   return 
1;
}
public 
OnFilterScriptExit()
{
    return 
1;
}
CMD:superid(playeridparams[])
{
    new 
str[256], Float:Pos[4], PlayerText3D:label;
    if(
superidof[playerid] == false)
    {
        
superidof[playerid] = true;
        
SendClientMessage(playerid0xFF4435FF"You've turned ON the Superid!");
        
        for(new 
0MAX_PLAYERSi++)
        {
            
GetPlayerPos(iPos[1], Pos[2], Pos[3]);
            
playerid;
            
format(str256"ID: %i"i);
            
CreatePlayer3DTextLabel(istr0xFF6642FFPos[1], Pos[2], Pos[3], 200.0, -11);
        }
    }
    if(
superidof[playerid] == true)
    {
        
superidof[playerid] = false;
        
SendClientMessage(playerid0xFF4435FF"You've turned OFF the Superid!");
        for(new 
0MAX_PLAYERSi++)
        {
            
DeletePlayer3DTextLabel(ilabel);
        }
    }
    return 
1;

try this
Reply
#3

Still not working.
Reply
#4

Bools, by default, if not defined are false, so there's no need to make them false again onplayerconnect. Try this:
pawn Код:
#include <a_samp>
#include <zcmd>

new bool: superidof[MAX_PLAYERS];

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Blank Filterscript by your name here");
    print("--------------------------------------\n");
    return 1;
}



public OnPlayerDisconnect(playerid)
{
    superidof[playerid] = false;
    }
    return 1;
}

public OnPlayerSpawn(playerid)
{
   superidof[playerid] = false;
   return 1;
}


CMD:superid(playerid, params[])
{
    new str[256], Float:Pos[3], PlayerText3D:label[MAX_PLAYERS]; //I am not sure about this
    if(superidof[playerid] == false)
    {
        superidof[playerid] = true;
        SendClientMessage(playerid, 0xFF4435FF, "You've turned ON the Superid!");

        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            GetPlayerPos(i, Pos[0], Pos[1], Pos[2]);
            format(str, 256, "ID: %i", i); //use somewhere this string
            CreatePlayer3DTextLabel(i, str, 0xFF6642FF, Pos[0], Pos[1], Pos[2], 200.0, -1, 1);
        }
    }
    else
    {
        superidof[playerid] = false;
        SendClientMessage(playerid, 0xFF4435FF, "You've turned OFF the Superid!");
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            DeletePlayer3DTextLabel(i, PlayerText3D:label[i]);
        }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)