[Pedido] Alguem me ajuda a converter isso pra por direto no meu gm
#1

Tenho uma FS mais eu quero por diretamente no GM alguem me ajuda plis?
Код:
#include <a_samp>

//----------------------------------------------------------------------------//

public OnFilterScriptInit() {
        print("\n-- Laser Pointer by Skiaffo --\n");
        new p = GetMaxPlayers();
        for (new i=0; i < p; i++) {
                SetPVarInt(i, "laser", 0);
                SetPVarInt(i, "color", 18643);
        }
        return 1;
}

public OnFilterScriptExit() {
        new p = GetMaxPlayers();
        for (new i=0; i < p; i++) {
                SetPVarInt(i, "laser", 0);
                RemovePlayerAttachedObject(i, 0);
        }
        return 1;
}

//----------------------------------------------------------------------------//

public OnPlayerSpawn(playerid) {
    if (!GetPVarInt(playerid, "color")) SetPVarInt(playerid, "color", 18643);
}

public OnPlayerDisconnect(playerid) {
        SetPVarInt(playerid, "laser", 0);
        RemovePlayerAttachedObject(playerid, 0);
        return 1;
}

//----------------------------------------------------------------------------//

public OnPlayerCommandText(playerid, cmdtext[]) {

        new cmd[256];
        new idx;
        cmd = strtok(cmdtext, idx);

        if (!strcmp("/laseron", cmdtext, true)) {
                SetPVarInt(playerid, "laser", 1);
                SetPVarInt(playerid, "color", GetPVarInt(playerid, "color"));
                return 1;
        }

        if (!strcmp("/laseroff", cmdtext, true)) {
                SetPVarInt(playerid, "laser", 0);
                RemovePlayerAttachedObject(playerid, 0);
                return 1;
        }

        if (!strcmp("/lasercor", cmd, true)) {
                new tmp[256];
                tmp = strtok(cmdtext, idx);
                if (!strlen(tmp)) {
                        SendClientMessage(playerid, 0x00E800FF, "Usage: /lasercor [cor]");
                        return 1;
                }
                if (!strcmp(tmp, "vermelho", true)) SetPVarInt(playerid, "color", 18643);
                else if (!strcmp(tmp, "azul", true)) SetPVarInt(playerid, "color", 19080);
                else if (!strcmp(tmp, "rosa", true)) SetPVarInt(playerid, "color", 19081);
                else if (!strcmp(tmp, "laranja", true)) SetPVarInt(playerid, "color", 19082);
                else if (!strcmp(tmp, "verde", true)) SetPVarInt(playerid, "color", 19083);
                else if (!strcmp(tmp, "amarelo", true)) SetPVarInt(playerid, "color", 19084);
                else SendClientMessage(playerid, 0x00E800FF, "Cor nгo disponivel!");
                return 1;
        }

        return 0;
}

public OnPlayerUpdate(playerid) {
        if (GetPVarInt(playerid, "laser")) {
                RemovePlayerAttachedObject(playerid, 0);
                if ((IsPlayerInAnyVehicle(playerid)) || (IsPlayerInWater(playerid))) return 1;
                switch (GetPlayerWeapon(playerid)) {
                        case 23: {
                                if (IsPlayerAiming(playerid)) {
                                        if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
                                                SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // SP standing aiming
                                                0.108249, 0.030232, 0.118051, 1.468254, 350.512573, 364.284240);
                                        } else {
                                                SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // SP crouched aiming
                                                0.108249, 0.030232, 0.118051, 1.468254, 349.862579, 364.784240);
                                        }
                                } else {
                                        if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
                                                SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // SP standing not aiming
                                                0.078248, 0.027239, 0.113051, -11.131746, 350.602722, 362.384216);
                                        } else {
                                                SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // SP crouched not aiming
                                                0.078248, 0.027239, 0.113051, -11.131746, 350.602722, 362.384216);
                        }       }       }
                        case 27: {
                                if (IsPlayerAiming(playerid)) {
                                        if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
                                                SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // SPAS standing aiming
                                                0.588246, -0.022766, 0.138052, -11.531745, 347.712585, 352.784271);
                                        } else {
                                                SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // SPAS crouched aiming
                                                0.588246, -0.022766, 0.138052, 1.468254, 350.712585, 352.784271);
                                        }
                                } else {
                                        if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
                                                SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // SPAS standing not aiming
                                                0.563249, -0.01976, 0.134051, -11.131746, 351.602722, 351.384216);
                                        } else {
                                                SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // SPAS crouched not aiming
                                                0.563249, -0.01976, 0.134051, -11.131746, 351.602722, 351.384216);
                        }       }       }
                        case 30: {
                                if (IsPlayerAiming(playerid)) {
                                        if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
                                                SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // AK standing aiming
                                                0.628249, -0.027766, 0.078052, -6.621746, 352.552642, 355.084289);
                                        } else {
                                                SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // AK crouched aiming
                                                0.628249, -0.027766, 0.078052, -1.621746, 356.202667, 355.084289);
                                        }
                                } else {
                                        if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
                                                SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // AK standing not aiming
                                                0.663249, -0.02976, 0.080051, -11.131746, 358.302734, 353.384216);
                                        } else {
                                                SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // AK crouched not aiming
                                                0.663249, -0.02976, 0.080051, -11.131746, 358.302734, 353.384216);
                        }       }       }
                        case 31: {
                                if (IsPlayerAiming(playerid)) {
                                        if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
                                                SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // M4 standing aiming
                                                0.528249, -0.020266, 0.068052, -6.621746, 352.552642, 355.084289);
                                        } else {
                                                SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // M4 crouched aiming
                                                0.528249, -0.020266, 0.068052, -1.621746, 356.202667, 355.084289);
                                        }
                                } else {
                                        if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
                                                SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // M4 standing not aiming
                                                0.503249, -0.02376, 0.065051, -11.131746, 357.302734, 354.484222);
                                        } else {
                                                SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // M4 crouched not aiming
                                                0.503249, -0.02376, 0.065051, -11.131746, 357.302734, 354.484222);
                        }       }       }
			case 34: {
				if (IsPlayerAiming(playerid)) {
					/*if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
						SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // Sniper standing aiming
						0.528249, -0.020266, 0.068052, -6.621746, 352.552642, 355.084289);
					} else {
						SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // Sniper crouched aiming
						0.528249, -0.020266, 0.068052, -1.621746, 356.202667, 355.084289);
					}*/
					return 1;
				} else {
					if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
						SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // Sniper standing not aiming
						0.658248, -0.03276, 0.133051, -11.631746, 355.302673, 353.584259);
					} else {
						SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // Sniper crouched not aiming
						0.658248, -0.03276, 0.133051, -11.631746, 355.302673, 353.584259);
			}	}	}
                        case 29: {
                                if (IsPlayerAiming(playerid)) {
                                        if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
                                                SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // MP5 standing aiming
                                                0.298249, -0.02776, 0.158052, -11.631746, 359.302673, 357.584259);
                                        } else {
                                                SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // MP5 crouched aiming
                                                0.298249, -0.02776, 0.158052, 8.368253, 358.302673, 352.584259);
                                        }
                                } else {
                                        if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
                                                SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // MP5 standing not aiming
                                                0.293249, -0.027759, 0.195051, -12.131746, 354.302734, 352.484222);
                                        } else {
                                                SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // MP5 crouched not aiming
                                                0.293249, -0.027759, 0.195051, -12.131746, 354.302734, 352.484222);
        }       }       }       }       }
        return 1;
}

stock IsPlayerInWater(playerid) {
        new anim = GetPlayerAnimationIndex(playerid);
        if (((anim >=  1538) && (anim <= 1542)) || (anim == 1544) || (anim == 1250) || (anim == 1062)) return 1;
        return 0;
}

stock IsPlayerAiming(playerid) {
	new anim = GetPlayerAnimationIndex(playerid);
	if (((anim >= 1160) && (anim <= 1163)) || (anim == 1167) || (anim == 1365) ||
	(anim == 1643) || (anim == 1453) || (anim == 220)) return 1;
        return 0;
}

//----------------------------------------------------------------------------//

strtok(const string[], &index)
{
        new length = strlen(string);
        while ((index < length) && (string[index] <= ' '))
        {
                index++;
        }

        new offset = index;
        new result[20];
        while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
        {
                result[index - offset] = string[index];
                index++;
        }
        result[index - offset] = EOS;
        return result;
}

//----------------------------------------------------------------------------//
Reply
#2

uai como assim ?

alguem aqui tem seu gm ?

isso e impossivel de fazer para voce e so voce ir olhando os nomes e colocando no gm .
Reply
#3

se der erro vc me ajuda atirar ?
Reply
#4

o que tiver em
public OnFilterScriptInit()

coloca em
public OnGameModeInit()

//=============================
o que tiver em public OnFilterScriptExit()

coloca em
public OnGameModeExit()
//=============================
o resto nao copias as public por que elas ja se encontra no seu gamemode depois e so copiar e adicionar nas includes do seu gamemode
Reply
#5

Onde eu coloco a
Код:
strtok(const string[], &index)
{
        new length = strlen(string);
        while ((index < length) && (string[index] <= ' '))
        {
                index++;
        }

        new offset = index;
        new result[20];
        while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
        {
                result[index - offset] = string[index];
                index++;
        }
        result[index - offset] = EOS;
        return result;
}
Reply
#6

Quote:
Originally Posted by Vinicius_TroLL
Посмотреть сообщение
Onde eu coloco a
Код:
strtok(const string[], &index)
{
        new length = strlen(string);
        while ((index < length) && (string[index] <= ' '))
        {
                index++;
        }

        new offset = index;
        new result[20];
        while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
        {
                result[index - offset] = string[index];
                index++;
        }
        result[index - offset] = EOS;
        return result;
}
Acho que no final do gamemode .
Reply
#7

Deu erros ajuda ai ?
Код:
C:\Documents and Settings\Usuario\Desktop\Viniciu$\BRV\pawno\include\seif_walk.inc(39) : error 004: function "Walk_OnPlayerKeyStateChange" is not implemented
C:\Documents and Settings\Usuario\Desktop\Viniciu$\BRV\pawno\include\servermoneyGM.inc(10) : error 079: inconsistent return types (array & non-array)
C:\Documents and Settings\Usuario\Desktop\Viniciu$\BRV\pawno\include\servermoneyGM.inc(16) : error 004: function "GMExit" is not implemented
C:\Documents and Settings\Usuario\Desktop\Viniciu$\BRV\pawno\include\servermoneyGM.inc(47) : error 004: function "OnPlayerHaveExtraCash" is not implemented
C:\Documents and Settings\Usuario\Desktop\Viniciu$\com o laser\RealidadeVirtual.pwn(584) : error 004: function "split" is not implemented
C:\Documents and Settings\Usuario\Desktop\Viniciu$\com o laser\RealidadeVirtual.pwn(964) : error 004: function "OnPropUpdate" is not implemented
C:\Documents and Settings\Usuario\Desktop\Viniciu$\com o laser\RealidadeVirtual.pwn(964) : error 004: function "SaveCars" is not implemented
C:\Documents and Settings\Usuario\Desktop\Viniciu$\com o laser\RealidadeVirtual.pwn(1052) : error 004: function "split" is not implemented
C:\Documents and Settings\Usuario\Desktop\Viniciu$\com o laser\RealidadeVirtual.pwn(1091) : error 004: function "split" is not implemented
C:\Documents and Settings\Usuario\Desktop\Viniciu$\com o laser\RealidadeVirtual.pwn(1901) : error 017: undefined symbol "GetPlayerOrg"
C:\Documents and Settings\Usuario\Desktop\Viniciu$\com o laser\RealidadeVirtual.pwn(1908) : error 017: undefined symbol "GetPlayerOrg"
C:\Documents and Settings\Usuario\Desktop\Viniciu$\com o laser\RealidadeVirtual.pwn(1981) : error 004: function "OnPlayerText" is not implemented
C:\Documents and Settings\Usuario\Desktop\Viniciu$\com o laser\RealidadeVirtual.pwn(1996) : error 004: function "OnPlayerText" is not implemented
C:\Documents and Settings\Usuario\Desktop\Viniciu$\com o laser\RealidadeVirtual.pwn(2000) : error 004: function "OnPlayerText" is not implemented
C:\Documents and Settings\Usuario\Desktop\Viniciu$\com o laser\RealidadeVirtual.pwn(2026) : error 004: function "OnPlayerText" is not implemented
C:\Documents and Settings\Usuario\Desktop\Viniciu$\com o laser\RealidadeVirtual.pwn(2031) : error 004: function "OnPlayerText" is not implemented
C:\Documents and Settings\Usuario\Desktop\Viniciu$\com o laser\RealidadeVirtual.pwn(2038) : error 004: function "OnPlayerText" is not implemented
C:\Documents and Settings\Usuario\Desktop\Viniciu$\com o laser\RealidadeVirtual.pwn(2049) : error 017: undefined symbol "IsNumeric"
C:\Documents and Settings\Usuario\Desktop\Viniciu$\com o laser\RealidadeVirtual.pwn(2052) : error 004: function "OnPlayerText" is not implemented
C:\Documents and Settings\Usuario\Desktop\Viniciu$\com o laser\RealidadeVirtual.pwn(2059) : error 004: function "OnPlayerText" is not implemented
C:\Documents and Settings\Usuario\Desktop\Viniciu$\com o laser\RealidadeVirtual.pwn(2064) : error 017: undefined symbol "IsNumeric"
C:\Documents and Settings\Usuario\Desktop\Viniciu$\com o laser\RealidadeVirtual.pwn(2067) : error 004: function "OnPlayerText" is not implemented
C:\Documents and Settings\Usuario\Desktop\Viniciu$\com o laser\RealidadeVirtual.pwn(2075) : error 004: function "OnPlayerCommandText" is not implemented
C:\Documents and Settings\Usuario\Desktop\Viniciu$\com o laser\RealidadeVirtual.pwn(2087) : error 017: undefined symbol "GetName"
C:\Documents and Settings\Usuario\Desktop\Viniciu$\com o laser\RealidadeVirtual.pwn(2088) : error 017: undefined symbol "GetName"
C:\Documents and Settings\Usuario\Desktop\Viniciu$\com o laser\RealidadeVirtual.pwn(2089) : error 017: undefined symbol "GetName"
Reply
#8

Vocк abriu uma chave e nгo a fechou
Reply
#9

cara seu gamemode tem quantas linhas ?

se for menos de 500 se voce quiser postar eu adiciono pra voce
Reply
#10

Nao йh chave, eu confiri:C me ajudem por favor ou alguem me passa o code do laser sу pra mim por direto no no gm por favor
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)