Jump to content
  • 0

GameMod...Nu merge.


Question

Posted

Am incercat sa-mi fac singur un gamemod,dar de cate ori pornesc serverul imi da urmatoarea eroare:

Poza:

?dm=2129649323711

Sursa:

#include <a_samp>

#define COLOR_RED 0xAA3333AA
#define COLOR_GREEN 0x33AA33AA
/////////////////////////////////////////////////////////////////////
public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" TheHbK2310 Script is ON");
    print("--------------------------------------\n");
    return 1;
}
/////////////////////////////////////////////////////////////////////
public OnPlayerSpawn(playerid)
{
    new PlayerName[MAX_PLAYER_NAME],
    string[128];
    GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
    format(string, sizeof(string), "%s has spawned.", PlayerName);
    SendClientMessageToAll(COLOR_GREEN, string);
    return 1;
}
/////////////////////////////////////////////////////////////////////
public OnGameModeInit( )
{
    // Add a Hydra to the game with a respawn time of 60 seconds
    CreateVehicle(520, 2109.1763, 1503.0453, 32.2887, 82.2873, 0, 1, 60);
    print("HbK2310 Mod Started!");
    return 1;
}
/////////////////////////////////////////////////////////////////////
public OnPlayerConnect(playerid)
{
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"%s has joined the server. Welcome!",pName);
    SendClientMessageToAll(COLOR_RED,string);
    return 1;
}
/////////////////////////////////////////////////////////////////////
public OnPlayerDisconnect(playerid, reason)
{
    new
        string[64],
        name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,MAX_PLAYER_NAME);
    switch(reason)
    {
        case 0: format(string,sizeof string,"%s left the server. (Timed out)",name);
        case 1: format(string,sizeof string,"%s left the server. (Leaving)",name);
        case 2: format(string,sizeof string,"%s left the server. (Kicked/Banned)",name);
    }
    SendClientMessageToAll(COLOR_RED,string);
    return 1;
}
/////////////////////////////////////////////////////////////////////
public OnVehicleSpawn(vehicleid)
{
    printf("Vehicle %i spawned!",vehicleid);
    return 1;
}
/////////////////////////////////////////////////////////////////////
public OnGameModeExit()
{
    print("Gamemode ended.");
    return 1;
}
/////////////////////////////////////////////////////////////////////
public OnFilterScriptExit()
{
	print("\n--------------------------------------");
	print(" My script Unloaded");
	print("--------------------------------------\n");
	return 1;
}

10 answers to this question

Recommended Posts

Posted

Gandeste si tu un pic ba e Gm ba e Fs?

Uite un exemplu:

/////////////////////////////////////////////////////////////////////
public OnGameModeExit()
{
    print("Gamemode ended.");
    return 1;
}
/////////////////////////////////////////////////////////////////////
public OnFilterScriptExit()
{
   print("\n--------------------------------------");
   print(" My script Unloaded");
   print("--------------------------------------\n");
   return 1;
}

> --- http://pastebin.com/2AgG2au7 --- < Ti-l-am facut

Posted

Incearca asa:

#include <a_samp>

#define COLOR_RED 0xAA3333AA
#define COLOR_GREEN 0x33AA33AA

main(){}
public OnGameModeInit( )
{
    // Add a Hydra to the game with a respawn time of 60 seconds
    CreateVehicle(520, 2109.1763, 1503.0453, 32.2887, 82.2873, 0, 1, 60);
    print("HbK2310 Mod Started!");
    return 1;
}
/////////////////////////////////////////////////////////////////////
public OnGameModeExit()
{
    print("Gamemode ended.");
    return 1;
}
/////////////////////////////////////////////////////////////////////
public OnPlayerConnect(playerid)
{
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"%s has joined the server. Welcome!",pName);
    SendClientMessageToAll(COLOR_RED,string);
    return 1;
}
/////////////////////////////////////////////////////////////////////
public OnPlayerDisconnect(playerid, reason)
{
    new
        string[64],
        name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,MAX_PLAYER_NAME);
    switch(reason)
    {
        case 0: format(string,sizeof string,"%s left the server. (Timed out)",name);
        case 1: format(string,sizeof string,"%s left the server. (Leaving)",name);
        case 2: format(string,sizeof string,"%s left the server. (Kicked/Banned)",name);
    }
    SendClientMessageToAll(COLOR_RED,string);
    return 1;
}
/////////////////////////////////////////////////////////////////////
public OnPlayerSpawn(playerid)
{
    new PlayerName[MAX_PLAYER_NAME],
    string[128];
    GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
    format(string, sizeof(string), "%s has spawned.", PlayerName);
    SendClientMessageToAll(COLOR_GREEN, string);
    return 1;
}
/////////////////////////////////////////////////////////////////////
public OnVehicleSpawn(vehicleid)
{
    printf("Vehicle %i spawned!",vehicleid);
    return 1;
}

Posted

In loc de:

public OnPlayerSpawn(playerid)
{
    new PlayerName[MAX_PLAYER_NAME],
    string[128];
    GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
    format(string, sizeof(string), "%s has spawned.", PlayerName);
    SendClientMessageToAll(COLOR_GREEN, string);
    return 1;
}
sa pun:
public OnPlayerCommandText(playerid,cmdtext[])
{
    if(!strcmp(cmdtext,"/middle",true))
    {            
        SetPlayerPos(playerid,0.0,0.0,6.0);
        return 1;
    }
    return 0;
}

Vreau sa modific locatia la spawn la playerul care intra pe server.

Posted

Am zis ca la OnPlayerSpawn sa pui SetPlayerPos, nu tot OnPlayerCommandText >.<"

public OnPlayerSpawn(playerid)
{
    new PlayerName[MAX_PLAYER_NAME],
    string[128];
    GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
    format(string, sizeof(string), "%s has spawned.", PlayerName);
    SendClientMessageToAll(COLOR_GREEN, string);
    return 1;
}
=>
public OnPlayerSpawn(playerid)
{
    new PlayerName[MAX_PLAYER_NAME],
    string[128];
    GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
    format(string, sizeof(string), "%s has spawned.", PlayerName);
    SendClientMessageToAll(COLOR_GREEN, string);
    SetPlayerPos(playerid,0.0,0.0,0.6);
    return 1;
}

Asta vine in centrul mapei, sub pamant, mai bine schimbi pozitia cu /save in joc. Pe viitor uita-te pe wiki: http://wiki.sa-mp.com/

Posted

http://www.sa-mp.ro/forum/index.php/topic,7497.0.html aici te invatza

App Hbk a intrat in hall of fame  :kiss: :kiss: :kiss: :kiss: :evil: :evil: :evil:

u78ch.jpg

CHECK MY CHANNEL!

http://www.youtube.com/user/amysoica

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.