[Ajuda] AJUDA GM
#1

galera essa GM E Pequena Base, porque uso um fs que completa ela. eu nгo mecho muito com pwn, eu queria pedir ajuda tipow porque quando 1 fala todos do server ver, nimguem sabe ai como coloca para falar e so quem tive perto ver? se souber agradeceria por uma ajuda

Код:
// Converted using AdvancedConverter (MTA to SA:MP)
#include <a_samp>
#pragma tabsize 0

#define VERMELHO 0xAA3333AA
#define VERDE    0x33AA33AA
#define BRANCO   0xFFFFFFAA
#define LARANJA  0xFF9900AA
#define AMARELO  0xFFFF00AA
#define AZUL     0x33CCFFAA
#define ROSA     0xFF00FFAA
#define CINZA    0xAFAFAFAA
#define VERDEC   0x7FFF00AA
#define VERMELHA 0xDD0000FF
#define AZULESCU 0x0000FFAA
#define PRETO    0x00000000

main()
{
	print("\n----------------------------------");
	print("  GM GTA Torcidas\n");
	print("         By");
	print("            [JGSA]Mateus");
	print("----------------------------------\n");
}

public OnGameModeInit()
{
	SetGameModeText("BGT TORCIDAS 1.0!");
	SendRconCommand("mapname Torcidas Organizadas");
	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, 2668.46,-2530.95,13.8598);
	SetPlayerCameraPos(playerid, 2675.19,-2533.78,12.9638);
	SetPlayerCameraLookAt(playerid, 2668.46,-2530.95,13.8598);
	return 1;
}

public OnPlayerRequestSpawn(playerid)
{
	return 1;
}

public OnPlayerConnect(playerid)
{
    GameTextForPlayer(playerid,"~g~Seja Bem Vindo~y~(a) ~b~a ~g~BGT Torcidas ~y~Servidor!",5000,3);
    SendClientMessage(playerid, AZUL, "GTA Torcidas Servidor de SA-MP!");
    SendClientMessage(playerid, VERDE, "Dono do server : Gabriel e Joker!");
    SendClientMessage(playerid, VERMELHO, "----------------------------------------------------------------------------------");
    SendClientMessage(playerid, BRANCO, "--> Para ler as Regras digite (/regras)");
    SendClientMessage(playerid, BRANCO, "--> Para ver os comandos digite (/comandos)");
    SendClientMessage(playerid, BRANCO, "--> Para ver os Creditos Digite (/creditos)");
    SendClientMessage(playerid, VERMELHO, "----------------------------------------------------------------------------------");
    SendClientMessage(playerid, LARANJA, "O melhor servidor de Torcidas !");
    SendClientMessage(playerid, LARANJA, "Para se logar digite /login [senha]!Mais se ainda nгo й registrado digite /registrar [senha]");
	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;
}
forward OnPlayerPrivmsg(playerid, recieverid, text[]);
public OnPlayerPrivmsg(playerid, recieverid, text[])
{
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	    			    if (strcmp("/comandos", cmdtext, true, 10) == 0)
	    {
	    SendClientMessage(playerid, VERMELHO,"----------------------------------------------------------");
    	SendClientMessage(playerid, VERDE, "/creditos - Veja os creditos do Game Mode!");
    	SendClientMessage(playerid, VERDE, "/mudartorcida - Mude Torcida!");
    	SendClientMessage(playerid, VERDE, "/fundadores - Veja os Fundador do server!");
    	SendClientMessage(playerid, VERDE, "/gps - para ir para algum lugar.");
    	SendClientMessage(playerid, VERDE, "/kit - para comprar armas.");
    	SendClientMessage(playerid, VERMELHO,"----------------------------------------------------------");
	    return 1;
	    }
	                    if (strcmp("/creditos", cmdtext, true, 10) == 0)
        {
        SendClientMessage(playerid, VERMELHO,"----------------------------------------------------------");
        SendClientMessage(playerid, VERDE, "Server feito por : Gabriel e Joker");
       	SendClientMessage(playerid, VERDE, "Ajudante : N/A");
        SendClientMessage(playerid, VERDE, "Dono do servidor : Gabriel e Joker");
        SendClientMessage(playerid, VERMELHO,"----------------------------------------------------------");
		return 1;
		}
		                if (strcmp("/fundadores", cmdtext, true, 10) == 0)
        {
        SendClientMessage(playerid, VERMELHO,"----------------------------------------------------------");
        SendClientMessage(playerid, AZUL, "Gabriel e Joker.");
        SendClientMessage(playerid, VERMELHO,"----------------------------------------------------------");
		return 1;
		}
		                if (strcmp("/regras", cmdtext, true, 10) == 0)
	    {
	    SendClientMessage(playerid, VERMELHO,"----------------------------------------------------------");
		SendClientMessage(playerid, VERMELHO, "1-Nгo use Cheaters(Se usar ira ser BANIDO)");
        SendClientMessage(playerid, VERMELHO, "2-Respeite os outros Players(KICK e se desrrespeitar de novo serб BAN)");
        SendClientMessage(playerid, VERMELHO, "3-Respeite os ADM's(Se nгo respeitar sera BAN)");
        SendClientMessage(playerid, VERMELHO, "4-Nгo atropele!!");
        SendClientMessage(playerid, VERMELHO, "5-Torca com GRITOS de torcida e nao com chingamentos!(SE chingar BAN)");
        SendClientMessage(playerid, VERMELHO,"----------------------------------------------------------");
		return 1;
		}
		if (strcmp("/sedenaopegane", cmdtext, true, 10) == 0)
         if(IsPlayerInAnyVehicle(playerid)) {
        new VehicleID;
        VehicleID = GetPlayerVehicleID(playerid);
        SetVehiclePos(VehicleID,-1959.46,290.708,35.1138);
        SetVehicleZAngle(GetPlayerVehicleID(playerid),0);
        SetPlayerInterior(playerid,0);
        }
        else{
        SetPlayerInterior(playerid,0);
        SetPlayerPos(playerid,-1959.46,290.708,35.1138);
        SetPlayerFacingAngle(playerid,0);
		}
		return 1;
		if (strcmp("/sededsfsfs", cmdtext, true, 10) == 0)
         if(IsPlayerInAnyVehicle(playerid)) {
        new VehicleID;
        VehicleID = GetPlayerVehicleID(playerid);
        SetVehiclePos(VehicleID,2224.63,-1154.52,25.5114);
        SetVehicleZAngle(GetPlayerVehicleID(playerid),0);
        SetPlayerInterior(playerid,0);
        }
        else{
        SetPlayerInterior(playerid,0);
        SetPlayerPos(playerid,2224.63,-1154.52,25.5114);
        SetPlayerFacingAngle(playerid,0);
		}
		return 1;
		if (strcmp("/cmsicmsimcsiamca", cmdtext, true, 10) == 0)
         if(IsPlayerInAnyVehicle(playerid)) {
        new VehicleID;
        VehicleID = GetPlayerVehicleID(playerid);
        SetVehiclePos(VehicleID,1352.73,2161.05,10.6409);
        SetVehicleZAngle(GetPlayerVehicleID(playerid),0);
        SetPlayerInterior(playerid,0);
        }
        else{
        SetPlayerInterior(playerid,0);
        SetPlayerPos(playerid,1352.73,2161.05,10.6409);
        SetPlayerFacingAngle(playerid,0);
		}
		return 1;
	return SendClientMessage(playerid,AZULESCU,"BGT Torcidas:Esse comando nгo existe!!!");
}
forward OnPlayerInfoChange(playerid);
public OnPlayerInfoChange(playerid)
{
	return 1;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
	return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
	return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
	return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
	return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
	return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
	return 1;
}

public OnRconCommand(cmd[])
{
	return 1;
}

public OnObjectMoved(objectid)
{
	return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
	return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
	return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
	return 1;
}

public OnPlayerExitedMenu(playerid)
{
	return 1;
}
Reply
#2

https://sampforum.blast.hk/showthread.php?tid=317916
Reply
#3

pawn Код:
if(!strcmp(cmd, "/p", true))
{
new tmp[128];
strmid(tmp, cmdtext, 3, strlen(cmdtext), 128);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_RED, "/f [texto]");
new Float:diegox,Float:diegoy,Float:diegoz;
format(tmp, sizeof(tmp), "|»»| Chat Prуximo |««| %s: %s", PlayerName(playerid), tmp);
GetPlayerPos(playerid, diegox, diegoy, diegoz);
for(new diego; diego < MAX_PLAYERS; diego++)
{
if(IsPlayerInRangeOfPoint(diego, 10.0, diegox, diegoy, diegoz))//o 10.0 й a бrea que o chat pega
{
SendClientMessage(diego, COLOR_RED, tmp);
}
}
return 1;
}
ta aн
achei isso em um gm meu por aki de quando eu estudava pawn
Reply
#4

Coloque essa public ‼

pawn Код:
public OnPlayerText(playerid,text[])
{
    new Msg[128],Name[24],Float:Coords[3];
    GetPlayerPos(playerid,Coords[0],Coords[1],Coords[2]);
    GetPlayerName(playerid,Name,sizeof(Name));
    format(Msg,sizeof(Msg),"%s diz: %s",Name,text);
    for(new x = 0; x != MAX_PLAYERS; x++) {
        if(IsPlayerInRangeOfPoint(x,20.0,Coords[0],Coords[1],Coords[2])) {
            SendClientMessage(x,-1,Msg);
        }
    }
    return false;
}//Espero ter ajudalo !
Reply
#5

Tipow nгo tem como o chat proximo ser sem comandos? e o chat que for pra todos agente tem no fs /asay pros vips, pros orgs, e pros admts :X
Reply
#6

Quote:
Originally Posted by maluco88
Посмотреть сообщение
Tipow nгo tem como o chat proximo ser sem comandos? e o chat que for pra todos agente tem no fs /asay pros vips, pros orgs, e pros admts :X
pawn Код:
//Ponha no GameMode  e nгo vai ter mais problema com Chat Global '

public OnPlayerText(playerid, text[])
{
    if(text[0] == '#')
    {
        new n[24],s[128],Float:Pos[3];
        GetPlayerName(playerid,n,24);
        format(s,128,"%s diz:s%",n,text[1]);
        GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
        for(new i = 0 ; i < GetMaxPlayers(); i++) {
            if(IsPlayerInRangeOfPoint(i,2,Pos[0],Pos[1],Pos[2]))
            {
                SendClientMessage(i,-1,s);
            }
        }
    }
    return false;
}
Reply
#7

Quote:
Originally Posted by Life Advanced
Посмотреть сообщение
pawn Код:
//Ponha no GameMode  e nгo vai ter mais problema com Chat Global '

public OnPlayerText(playerid, text[])
{
    if(text[0] == '#')
    {
        new n[24],s[128],Float:Pos[3];
        GetPlayerName(playerid,n,24);
        format(s,128,"%s diz:s%",n,text[1]);
        GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
        for(new i = 0 ; i < GetMaxPlayers(); i++) {
            if(IsPlayerInRangeOfPoint(i,2,Pos[0],Pos[1],Pos[2]))
            {
                SendClientMessage(i,-1,s);
            }
        }
    }
    return false;
}
Agora nгo aparece nada ao digitar :/
Reply
#8

Quote:
Originally Posted by maluco88
Посмотреть сообщение
Agora nгo aparece nada ao digitar :/
Tentou usar esse

Coloque essa public ‼

pawn Код:
public OnPlayerText(playerid,text[])
{
    new Msg[128],Name[24],Float:Coords[3];
    GetPlayerPos(playerid,Coords[0],Coords[1],Coords[2]);
    GetPlayerName(playerid,Name,sizeof(Name));
    format(Msg,sizeof(Msg),"%s diz: %s",Name,text);
    for(new x = 0; x != MAX_PLAYERS; x++) {
        if(IsPlayerInRangeOfPoint(x,20.0,Coords[0],Coords[1],Coords[2])) {
            SendClientMessage(x,-1,Msg);
        }
    }
    return false;
}//Espero ter ajudalo !
Reply
#9

RESOLVIR envez de return false; coloquei return 1 funfo vlws
Reply
#10

Quote:
Originally Posted by maluco88
Посмотреть сообщение
RESOLVIR envez de return false; coloquei return 1 funfo vlws
De nada's
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)