SA-MP Forums Archive
CMD error! need help! - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: CMD error! need help! (/showthread.php?tid=264907)



CMD error! need help! - Eirikm - 28.06.2011

....


Re: CMD error! need help! - HyperZ - 28.06.2011

pawn Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
#define FILTERSCRIPT

#include <a_samp>

#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[])
{
    if(strcmp(cmdtext, "/gta4", true) == 0)
    {
        SetPlayerPos(playerid, 6980.54, 1294.16, 18.37);
        SetPlayerInterior(playerid, 0);
        SetPlayerVirtualWorld(playerid, 0);
        new Float:X, Float:Y, Float:Z;
        PlayerPlaySound(playerid, 1185, X, Y, Z);
        SendClientMessage(playerid, 0xFFAA00FF, "Esm`s Server Welkoms u To Grand Teft Auto 4 Map!");
        if(IsPlayerInAnyVehicle(playerid))
        {
            new vehicleid = GetPlayerVehicleID(playerid);
            SetVehiclePos(vehicleid, 6980.54, 1294.16, 18.37);
            LinkVehicleToInterior(vehicleid, 0);
            SetVehicleVirtualWorld(vehicleid, 0);
            PutPlayerInVehicle(playerid, vehicleid, 0);
        }
        return 1;
    }
    if(strcmp(cmdtext, "/sp", true) == 0)
    {
        SetPlayerPos(playerid, 4734.93, -2446.06, 11.00);
        SetPlayerInterior(playerid, 0);
        SetPlayerVirtualWorld(playerid, 0);
        GameTextForPlayer(playerid, "ESM`s Server: Welkom To The SwimmingPool!", 15000, 4);
        SendClientMessage(playerid, 0x0000FFFF, "ESM`S Server: To Stop The Music, Type: /ss  (stopsound)");
        return 1;
    }
    if(strcmp(cmdtext, "/ss", true) == 0)
    {
        PlayerPlaySound(playerid, 1098, 0, 0, 0);
        SendClientMessage(playerid, 0x0000FFFF, "ESM`S Server: U stopped the music!");
        return 1;
    }
    return 0;
}



AW: CMD error! need help! - Blowfish - 28.06.2011

You closed the following curly bracket before your command.

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
Код:
    }
	return 1;
	}


if(strcmp(cmdtext, "/ss", true) == 0)
{
    PlayerPlaySound(playerid, 1098, 0, 0, 0);
    SendClientMessage(playerid, 0x0000FFFF, "ESM`S Server: U stopped the music!");
    return 1;
}
So your command is not inside of the OnPlayerCommandText callback.


Re: CMD error! need help! - Eirikm - 28.06.2011

....