Does not work.UNKNOWN COMMAND.
#1

PHP код:
#include <a_samp>
#include <zcmd>
#include <sscanf2>
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
    print(
"\n--------------------------------------");
    print(
" Blank Filterscript by your name here");
    print(
"--------------------------------------\n");
    return 
1;
}
public 
OnFilterScriptExit()
{
    return 
1;
}
#else
main()
{
    print(
"\n----------------------------------");
    print(
" Blank Gamemode by your name here");
    print(
"----------------------------------\n");
}
#endif
public OnGameModeInit()
{
    
// Don't use these lines if it's a filterscript
    
SetGameModeText("Blank Script");
    
AddPlayerClass(01958.37831343.157215.3746269.1425000000);
    return 
1;
}
public 
OnGameModeExit()
{
    return 
1;
}
public 
OnPlayerRequestClass(playeridclassid)
{
    
SetPlayerPos(playerid1958.37831343.157215.3746);
    
SetPlayerCameraPos(playerid1958.37831343.157215.3746);
    
SetPlayerCameraLookAt(playerid1958.37831343.157215.3746);
    return 
1;
}
public 
OnPlayerConnect(playerid)
{
    return 
1;
}
public 
OnPlayerDisconnect(playeridreason)
{
    return 
1;
}
public 
OnPlayerSpawn(playerid)
{
    return 
1;
}
public 
OnPlayerDeath(playeridkilleridreason)
{
    return 
1;
}
public 
OnVehicleSpawn(vehicleid)
{
    return 
1;
}
public 
OnVehicleDeath(vehicleidkillerid)
{
    return 
1;
}
public 
OnPlayerText(playeridtext[])
{
    return 
1;
}
public 
OnPlayerCommandText(playeridcmdtext[])
{
CMD:minus(playerid,params[])
    {
        new 
Float:f1,Float:f2;
        if(
sscanf(params,"ff",f1,f2)) return SendClientMessage(playerid,-1,"Usage: /minus <first value><second value>");
        new 
Float:output f1-f2;
        new 
string[128];
        
format(string,sizeof(string),"Your answer is: %f",output);
        
SendClientMessage(playerid,-1,string);
        return 
1;
    }
CMD:multiplay(playerid,params[])
    {
        new 
Float:f1,Float:f2;
        if(
sscanf(params,"ff",f1,f2)) return SendClientMessage(playerid,-1,"Usage: /multiplay <first value><second value>");
        new 
Float:output f1*f2;
        new 
string[128];
        
format(string,sizeof(string),"Your answer is: %f",output);
        
SendClientMessage(playerid,-1,string);
        return 
1;
    }
CMD:plus(playerid,params[])
    {
        new 
Float:f1,Float:f2;
        if(
sscanf(params,"ff",f1,f2)) return SendClientMessage(playerid,-1,"Usage: /plus <first value><second value>");
        new 
Float:output f1+f2;
        new 
string[128];
        
format(string,sizeof(string),"Your answer is: %f",output);
        
SendClientMessage(playerid,-1,string);
        return 
1;
    }
CMD:divide(playerid,params[])
    {
        new 
Float:f1,Float:f2;
        if(
sscanf(params,"ff",f1,f2)) return SendClientMessage(playerid,-1,"Usage: /divide <first value><second value>");
        new 
Float:output f1/f2;
        new 
string[128];
        
format(string,sizeof(string),"Your answer is: %f",output);
        
SendClientMessage(playerid,-1,string);
        return 
1;
    }
return 
0;

Okay I tried to make a filterscript but it does not work.It says unknown command.Please can someone fix this for me.
Reply
#2

Don't do CMD:example(playerid,params[])

Inside of any callback.

That is your problem.
Reply
#3

pawn Код:
#include <a_samp>
#include <zcmd>
#include <sscanf2>
#if defined FILTERSCRIPT

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

public OnFilterScriptExit()
{
    return 1;
}

#else

main()
{
    print("\n----------------------------------");
    print(" Blank Gamemode by your name here");
    print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{
    // Don't use these lines if it's a filterscript
    SetGameModeText("Blank Script");
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    return 1;
}

public OnGameModeExit()
{
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
    return 1;
}

public OnPlayerConnect(playerid)
{
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    return 1;
}

public OnPlayerSpawn(playerid)
{
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    return 1;
}

public OnVehicleSpawn(vehicleid)
{
    return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
    return 1;
}

public OnPlayerText(playerid, text[])
{
    return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
    return 1;
}
CMD:minus(playerid,params[])
{
    new Float:f1,Float:f2;
    if(sscanf(params,"ff",f1,f2)) return SendClientMessage(playerid,-1,"Usage: /minus <first value><second value>");
    new Float:output = f1-f2;
    new string[128];
    format(string,sizeof(string),"Your answer is: %f",output);
    SendClientMessage(playerid,-1,string);
    return 1;
}
CMD:multiplay(playerid,params[])
{
    new Float:f1,Float:f2;
    if(sscanf(params,"ff",f1,f2)) return SendClientMessage(playerid,-1,"Usage: /multiplay <first value><second value>");
    new Float:output = f1*f2;
    new string[128];
    format(string,sizeof(string),"Your answer is: %f",output);
    SendClientMessage(playerid,-1,string);
    return 1;
}
CMD:plus(playerid,params[])
{
    new Float:f1,Float:f2;
    if(sscanf(params,"ff",f1,f2)) return SendClientMessage(playerid,-1,"Usage: /plus <first value><second value>");
    new Float:output = f1+f2;
    new string[128];
    format(string,sizeof(string),"Your answer is: %f",output);
    SendClientMessage(playerid,-1,string);
    return 1;
}
CMD:divide(playerid,params[])
{
    new Float:f1,Float:f2;
    if(sscanf(params,"ff",f1,f2)) return SendClientMessage(playerid,-1,"Usage: /divide <first value><second value>");
    new Float:output = f1/f2;
    new string[128];
    format(string,sizeof(string),"Your answer is: %f",output);
    SendClientMessage(playerid,-1,string);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)