[AJUDA]Comando abrir portao
#1

Alquem pode me ajudar eu tava tentando fazer um portao para abrir.mais e 2 portao mais eu nao consigo
Pf me ajudem

sou novo no panw Deis de ja obrigado




Код HTML:

#include <a_samp>

#if defined FILTERSCRIPT
new portao = 0, portaoz;
new portao2= 2, portaozz;
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");
}

//edit cassa
CreateObject(3502, 1249.388428, -730.477478, 92.170258, 0.0000, 0.0000, 22.5000);
CreateObject(976, 1241.124268, -767.295837, 91.218994, 0.0000, 0.0000, 0.0000);
CreateObject(976, 1321.073242, -816.034363, 71.719040, 0.0000, 0.0000, 270.0000);
CreateObject(976, 1321.094360, -824.628906, 72.697807, 0.0000, 0.0000, 270.0000);
CreateObject(976, 1249.876587, -767.324585, 91.247070, 0.0000, 0.0000, 0.0000);
CreateObject(987, 1281.393311, -841.984192, 74.470345, 0.0000, 0.0000, 0.0000);
CreateObject(987, 1269.449341, -841.986938, 74.543274, 0.0000, 0.0000, 0.0000);
CreateObject(987, 1258.083618, -844.195374, 73.307709, 0.0000, 0.0000, 11.2500);
CreateObject(987, 1246.561157, -846.469116, 72.836838, 0.0000, 0.0000, 11.2500);
CreateObject(987, 1234.961548, -847.827148, 72.273499, 0.0000, 0.0000, 6.9528);
CreateObject(987, 1223.282837, -849.283813, 72.326218, 0.0000, 0.0000, 6.9528);
CreateObject(987, 1211.899902, -850.671875, 74.311050, 0.0000, 0.0000, 6.9528);
CreateObject(987, 1202.645630, -843.254089, 74.444283, 0.0000, 0.0000, 321.9528);
CreateObject(987, 1199.622925, -841.073303, 78.422272, 0.0000, 0.0000, 321.9528);
CreateObject(987, 1198.329468, -829.405884, 78.259323, 0.0000, 0.0000, 276.9528);
CreateObject(987, 1199.167480, -817.754150, 78.479889, 0.0000, 0.0000, 265.7028);
CreateObject(987, 1199.751709, -806.245728, 79.844101, 0.0000, 0.0000, 265.7028);
CreateObject(987, 1204.979736, -795.702026, 80.355789, 0.0000, 0.0000, 243.2028);
CreateObject(987, 1206.531738, -792.833313, 83.751404, 0.0000, 0.0000, 243.2028);
CreateObject(987, 1210.234497, -785.275391, 86.145874, 0.0000, 0.0000, 243.2028);
CreateObject(987, 1214.964600, -775.903809, 87.293411, 0.0000, 0.0000, 243.2028);
CreateObject(987, 1218.951294, -768.025085, 89.717949, 0.0000, 0.0000, 243.2028);
CreateObject(987, 1230.788086, -766.694153, 90.585732, 0.0000, 0.0000, 186.9528);
CreateObject(987, 1239.848389, -766.810181, 89.309624, 0.0000, 0.0000, 180.0000);
CreateObject(987, 1239.832153, -766.831543, 93.911392, 0.0000, 0.0000, 180.0000);
CreateObject(3749, 1245.755371, -767.332153, 97.009697, 0.0000, 0.0000, 0.0000);
CreateObject(984, 1245.777954, -767.320618, 95.271416, 0.0000, 0.0000, 90.0000);
CreateObject(987, 1267.392822, -767.416016, 91.063705, 0.0000, 0.0000, 180.0000);
CreateObject(987, 1293.032593, -841.669556, 74.229248, 0.0000, 0.0000, 33.7500);
CreateObject(987, 1302.385620, -835.257813, 73.957123, 0.0000, 0.0000, 33.7500);
CreateObject(987, 1310.075073, -830.130066, 73.997475, 0.0000, 0.0000, 22.5000);
CreateObject(3749, 1320.497925, -821.272705, 77.990555, 0.0000, 0.0000, 90.0000);
CreateObject(987, 1320.340576, -810.664673, 77.054626, 0.0000, 0.0000, 90.0000);
CreateObject(987, 1320.251953, -799.893433, 78.485519, 0.0000, 0.0000, 90.0000);
CreateObject(987, 1320.399780, -793.894226, 83.275848, 0.0000, 0.0000, 90.0000);
CreateObject(987, 1320.445190, -782.075867, 86.160568, 0.0000, 0.0000, 90.0000);
CreateObject(987, 1320.373535, -779.419800, 90.600830, 0.0000, 0.0000, 90.0000);
CreateObject(987, 1320.376465, -767.454102, 90.999146, 0.0000, 0.0000, 180.0000);
CreateObject(987, 1308.292969, -767.515808, 90.987160, 0.0000, 0.0000, 180.0000);
CreateObject(987, 1296.329834, -767.560486, 90.971008, 0.0000, 0.0000, 180.0000);
CreateObject(987, 1284.452881, -767.397339, 91.380325, 0.0000, 0.0000, 180.0000);
CreateObject(987, 1272.689819, -767.522644, 91.006126, 0.0000, 0.0000, 180.0000);

#endif

public OnGameModeInit()
{
portao = CreateObject(976, 1241.124268, -767.295837, 91.218994, 0.0000, 0.0000, 0.0000);
portao2 = CreateObject(976, 1241.124268, -767.295837, 91.218994, 0.0000, 0.0000, 0.0000);
	// Don't use these lines if it's a filterscript

	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("/casap", cmdtext, true, 3)== 0)
{
if(portaoz == 0)
{
MoveObject(portao, 1241.124268, -767.295837, 91.218994, 0.0000, 0.0000, 0.0000, 5);
SendClientMessage(playerid, 0xAA3333AA, "Portao aberto" );
portaoz = 1);
}
else if(portaoz == 1)
{
MoveObject(portao,1249.876587, -767.324585, 91.247070, 0.0000, 0.0000, 0.0000, 5);
SendClientMessage(playerid, 0xAA3333AA, "Portao fechado" );
portaoz = 0;
}
return 1;
}
 if (strcmp("/casapp", cmdtext, true, 3)== 0)
{
if(portaozz == 0)
{
MoveObject(portao2, 1321.073242, -816.034363, 71.719040, 0.0000, 0.0000, 270.0000, 5);
SendClientMessage(playerid, 0xAA3333AA, "Portao aberto" );
portaoz = 1;
}
else if(portaozz == 2)
{
MoveObject(portao2,1321.094360, -824.628906, 72.697807, 0.0000, 0.0000, 270.0000, 5);
SendClientMessage(playerid, 0xAA3333AA, "Portao fechado" );
portaoz = 0;
}
return 1;
}
	return 0;
}

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 OnPlayerRequestSpawn(playerid)
{
	return 1;
}

public OnObjectMoved(objectid)
{
	return 1;
}

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

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

public OnVehicleMod(playerid, vehicleid, componentid)
{
	return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
	return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
	return 1;
}

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

public OnPlayerExitedMenu(playerid)
{
	return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
	return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
	return 1;
}

public OnPlayerUpdate(playerid)
{
	return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
	return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
	return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
	return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
	return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
	return 1;
}
ERROS
Код HTML:
C:\Documents and Settings\weverton\Desktop\casa.pwn(80) : error: 021: symbol already defined: "CreateObject"
C:\Documents and Settings\weverton\Desktop\casa.pwn(80) : error: 017: undefined symbol "portao"
C:\Documents and Settings\weverton\Desktop\casa.pwn(80) : error: 017: undefined symbol "portao2"
C:\Documents and Settings\weverton\Desktop\casa.pwn(80) : warning: 217: loose indentation
C:\Documents and Settings\weverton\Desktop\casa.pwn(80) : error: 017: undefined symbol "portaoz"
C:\Documents and Settings\weverton\Desktop\casa.pwn(80) : error: 017: undefined symbol "portao"
C:\Documents and Settings\weverton\Desktop\casa.pwn(80) : error: 017: undefined symbol "portaoz"
C:\Documents and Settings\weverton\Desktop\casa.pwn(80) : warning: 215: expression has no effect
C:\Documents and Settings\weverton\Desktop\casa.pwn(80) : error: 001: expected token: ";", but found ")"
C:\Documents and Settings\weverton\Desktop\casa.pwn(80) : error: 029: invalid expression, assumed zero
C:\Documents and Settings\weverton\Desktop\casa.pwn(80) : error fatal: 107: too many error messages on one line
Reply
#2

pawn Код:
#include <a_samp>

#if defined FILTERSCRIPT
new portao;
new portao2;
new portaoinfo;
new portao2info;
public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Blank Filterscript by your name here");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}


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

public OnGameModeInit()
{
portao = CreateObject(976, 1241.124268, -767.295837, 91.218994, 0.0000, 0.0000, 0.0000);
portao2 = CreateObject(976, 1241.124268, -767.295837, 91.218994, 0.0000, 0.0000, 0.0000);
//edit cassa
CreateObject(3502, 1249.388428, -730.477478, 92.170258, 0.0000, 0.0000, 22.5000);
CreateObject(976, 1241.124268, -767.295837, 91.218994, 0.0000, 0.0000, 0.0000);
CreateObject(976, 1321.073242, -816.034363, 71.719040, 0.0000, 0.0000, 270.0000);
CreateObject(976, 1321.094360, -824.628906, 72.697807, 0.0000, 0.0000, 270.0000);
CreateObject(976, 1249.876587, -767.324585, 91.247070, 0.0000, 0.0000, 0.0000);
CreateObject(987, 1281.393311, -841.984192, 74.470345, 0.0000, 0.0000, 0.0000);
CreateObject(987, 1269.449341, -841.986938, 74.543274, 0.0000, 0.0000, 0.0000);
CreateObject(987, 1258.083618, -844.195374, 73.307709, 0.0000, 0.0000, 11.2500);
CreateObject(987, 1246.561157, -846.469116, 72.836838, 0.0000, 0.0000, 11.2500);
CreateObject(987, 1234.961548, -847.827148, 72.273499, 0.0000, 0.0000, 6.9528);
CreateObject(987, 1223.282837, -849.283813, 72.326218, 0.0000, 0.0000, 6.9528);
CreateObject(987, 1211.899902, -850.671875, 74.311050, 0.0000, 0.0000, 6.9528);
CreateObject(987, 1202.645630, -843.254089, 74.444283, 0.0000, 0.0000, 321.9528);
CreateObject(987, 1199.622925, -841.073303, 78.422272, 0.0000, 0.0000, 321.9528);
CreateObject(987, 1198.329468, -829.405884, 78.259323, 0.0000, 0.0000, 276.9528);
CreateObject(987, 1199.167480, -817.754150, 78.479889, 0.0000, 0.0000, 265.7028);
CreateObject(987, 1199.751709, -806.245728, 79.844101, 0.0000, 0.0000, 265.7028);
CreateObject(987, 1204.979736, -795.702026, 80.355789, 0.0000, 0.0000, 243.2028);
CreateObject(987, 1206.531738, -792.833313, 83.751404, 0.0000, 0.0000, 243.2028);
CreateObject(987, 1210.234497, -785.275391, 86.145874, 0.0000, 0.0000, 243.2028);
CreateObject(987, 1214.964600, -775.903809, 87.293411, 0.0000, 0.0000, 243.2028);
CreateObject(987, 1218.951294, -768.025085, 89.717949, 0.0000, 0.0000, 243.2028);
CreateObject(987, 1230.788086, -766.694153, 90.585732, 0.0000, 0.0000, 186.9528);
CreateObject(987, 1239.848389, -766.810181, 89.309624, 0.0000, 0.0000, 180.0000);
CreateObject(987, 1239.832153, -766.831543, 93.911392, 0.0000, 0.0000, 180.0000);
CreateObject(3749, 1245.755371, -767.332153, 97.009697, 0.0000, 0.0000, 0.0000);
CreateObject(984, 1245.777954, -767.320618, 95.271416, 0.0000, 0.0000, 90.0000);
CreateObject(987, 1267.392822, -767.416016, 91.063705, 0.0000, 0.0000, 180.0000);
CreateObject(987, 1293.032593, -841.669556, 74.229248, 0.0000, 0.0000, 33.7500);
CreateObject(987, 1302.385620, -835.257813, 73.957123, 0.0000, 0.0000, 33.7500);
CreateObject(987, 1310.075073, -830.130066, 73.997475, 0.0000, 0.0000, 22.5000);
CreateObject(3749, 1320.497925, -821.272705, 77.990555, 0.0000, 0.0000, 90.0000);
CreateObject(987, 1320.340576, -810.664673, 77.054626, 0.0000, 0.0000, 90.0000);
CreateObject(987, 1320.251953, -799.893433, 78.485519, 0.0000, 0.0000, 90.0000);
CreateObject(987, 1320.399780, -793.894226, 83.275848, 0.0000, 0.0000, 90.0000);
CreateObject(987, 1320.445190, -782.075867, 86.160568, 0.0000, 0.0000, 90.0000);
CreateObject(987, 1320.373535, -779.419800, 90.600830, 0.0000, 0.0000, 90.0000);
CreateObject(987, 1320.376465, -767.454102, 90.999146, 0.0000, 0.0000, 180.0000);
CreateObject(987, 1308.292969, -767.515808, 90.987160, 0.0000, 0.0000, 180.0000);
CreateObject(987, 1296.329834, -767.560486, 90.971008, 0.0000, 0.0000, 180.0000);
CreateObject(987, 1284.452881, -767.397339, 91.380325, 0.0000, 0.0000, 180.0000);
CreateObject(987, 1272.689819, -767.522644, 91.006126, 0.0000, 0.0000, 180.0000);
    // Don't use these lines if it's a filterscript

    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("/casap", cmdtext, true, 3)== 0)
{
if(portaoinfo == 0)
{
MoveObject(portao, 1241.124268, -767.295837, 91.218994, 0.0000, 0.0000, 0.0000, 5);
SendClientMessage(playerid, 0xAA3333AA, "Portao aberto" );
portaoinfo = 1);
}
else if(portaoinfo == 1)
{
MoveObject(portao,1249.876587, -767.324585, 91.247070, 0.0000, 0.0000, 0.0000, 5);
SendClientMessage(playerid, 0xAA3333AA, "Portao fechado" );
portaoinfo = 0;
}
return 1;
}
 if (strcmp("/casapp", cmdtext, true, 3)== 0)
{
if(portao2info == 0)
{
MoveObject(portao2, 1321.073242, -816.034363, 71.719040, 0.0000, 0.0000, 270.0000, 5);
SendClientMessage(playerid, 0xAA3333AA, "Portao aberto" );
portao2info = 1;
}
else if(portao2info == 1)
{
MoveObject(portao2,1321.094360, -824.628906, 72.697807, 0.0000, 0.0000, 270.0000, 5);
SendClientMessage(playerid, 0xAA3333AA, "Portao fechado" );
portao2info = 0;
}
return 1;
}
    return 0;
}

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 OnPlayerRequestSpawn(playerid)
{
    return 1;
}

public OnObjectMoved(objectid)
{
    return 1;
}

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

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

public OnVehicleMod(playerid, vehicleid, componentid)
{
    return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
    return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
    return 1;
}

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

public OnPlayerExitedMenu(playerid)
{
    return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
    return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
    return 1;
}

public OnPlayerUpdate(playerid)
{
    return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
    return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
    return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
    return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
    return 1;
}
#endif
axo que й isso tente ae
Reply
#3

Quote:

#include <a_samp>

#if defined FILTERSCRIPT
new portao;
new portao2;
new portaoinfo;
new portao2info;
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
return 1;
}

public OnFilterScriptExit()
{
return 1;
}


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

public OnGameModeInit()
{
portao = CreateObject(976, 1241.124268, -767.295837, 91.218994, 0.0000, 0.0000, 0.0000);
portao2 = CreateObject(976, 1241.124268, -767.295837, 91.218994, 0.0000, 0.0000, 0.0000);
//edit cassa
CreateObject(3502, 1249.388428, -730.477478, 92.170258, 0.0000, 0.0000, 22.5000);
CreateObject(976, 1241.124268, -767.295837, 91.218994, 0.0000, 0.0000, 0.0000);
CreateObject(976, 1321.073242, -816.034363, 71.719040, 0.0000, 0.0000, 270.0000);
CreateObject(976, 1321.094360, -824.628906, 72.697807, 0.0000, 0.0000, 270.0000);
CreateObject(976, 1249.876587, -767.324585, 91.247070, 0.0000, 0.0000, 0.0000);
CreateObject(987, 1281.393311, -841.984192, 74.470345, 0.0000, 0.0000, 0.0000);
CreateObject(987, 1269.449341, -841.986938, 74.543274, 0.0000, 0.0000, 0.0000);
CreateObject(987, 1258.083618, -844.195374, 73.307709, 0.0000, 0.0000, 11.2500);
CreateObject(987, 1246.561157, -846.469116, 72.836838, 0.0000, 0.0000, 11.2500);
CreateObject(987, 1234.961548, -847.827148, 72.273499, 0.0000, 0.0000, 6.952;
CreateObject(987, 1223.282837, -849.283813, 72.326218, 0.0000, 0.0000, 6.952;
CreateObject(987, 1211.899902, -850.671875, 74.311050, 0.0000, 0.0000, 6.952;
CreateObject(987, 1202.645630, -843.254089, 74.444283, 0.0000, 0.0000, 321.952;
CreateObject(987, 1199.622925, -841.073303, 78.422272, 0.0000, 0.0000, 321.952;
CreateObject(987, 1198.329468, -829.405884, 78.259323, 0.0000, 0.0000, 276.952;
CreateObject(987, 1199.167480, -817.754150, 78.479889, 0.0000, 0.0000, 265.702;
CreateObject(987, 1199.751709, -806.245728, 79.844101, 0.0000, 0.0000, 265.702;
CreateObject(987, 1204.979736, -795.702026, 80.355789, 0.0000, 0.0000, 243.202;
CreateObject(987, 1206.531738, -792.833313, 83.751404, 0.0000, 0.0000, 243.202;
CreateObject(987, 1210.234497, -785.275391, 86.145874, 0.0000, 0.0000, 243.202;
CreateObject(987, 1214.964600, -775.903809, 87.293411, 0.0000, 0.0000, 243.202;
CreateObject(987, 1218.951294, -768.025085, 89.717949, 0.0000, 0.0000, 243.202;
CreateObject(987, 1230.788086, -766.694153, 90.585732, 0.0000, 0.0000, 186.952;
CreateObject(987, 1239.848389, -766.810181, 89.309624, 0.0000, 0.0000, 180.0000);
CreateObject(987, 1239.832153, -766.831543, 93.911392, 0.0000, 0.0000, 180.0000);
CreateObject(3749, 1245.755371, -767.332153, 97.009697, 0.0000, 0.0000, 0.0000);
CreateObject(984, 1245.777954, -767.320618, 95.271416, 0.0000, 0.0000, 90.0000);
CreateObject(987, 1267.392822, -767.416016, 91.063705, 0.0000, 0.0000, 180.0000);
CreateObject(987, 1293.032593, -841.669556, 74.229248, 0.0000, 0.0000, 33.7500);
CreateObject(987, 1302.385620, -835.257813, 73.957123, 0.0000, 0.0000, 33.7500);
CreateObject(987, 1310.075073, -830.130066, 73.997475, 0.0000, 0.0000, 22.5000);
CreateObject(3749, 1320.497925, -821.272705, 77.990555, 0.0000, 0.0000, 90.0000);
CreateObject(987, 1320.340576, -810.664673, 77.054626, 0.0000, 0.0000, 90.0000);
CreateObject(987, 1320.251953, -799.893433, 78.485519, 0.0000, 0.0000, 90.0000);
CreateObject(987, 1320.399780, -793.894226, 83.275848, 0.0000, 0.0000, 90.0000);
CreateObject(987, 1320.445190, -782.075867, 86.160568, 0.0000, 0.0000, 90.0000);
CreateObject(987, 1320.373535, -779.419800, 90.600830, 0.0000, 0.0000, 90.0000);
CreateObject(987, 1320.376465, -767.454102, 90.999146, 0.0000, 0.0000, 180.0000);
CreateObject(987, 1308.292969, -767.515808, 90.987160, 0.0000, 0.0000, 180.0000);
CreateObject(987, 1296.329834, -767.560486, 90.971008, 0.0000, 0.0000, 180.0000);
CreateObject(987, 1284.452881, -767.397339, 91.380325, 0.0000, 0.0000, 180.0000);
CreateObject(987, 1272.689819, -767.522644, 91.006126, 0.0000, 0.0000, 180.0000);
// Don't use these lines if it's a filterscript

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("/casap", cmdtext, true, 3)== 0)
{
if(portaoinfo == 0)
{
MoveObject(portao, 1241.124268, -767.295837, 91.218994, 0.0000, 0.0000, 0.0000, 5);
SendClientMessage(playerid, 0xAA3333AA, "Portao aberto" );
portaoinfo = 1);
}
else if(portaoinfo == 1)
{
MoveObject(portao,1249.876587, -767.324585, 91.247070, 0.0000, 0.0000, 0.0000, 5);
SendClientMessage(playerid, 0xAA3333AA, "Portao fechado" );
portaoinfo = 0;
}
return 1;
}
if (strcmp("/casapp", cmdtext, true, 3)== 0)
{
if(portao2info == 0)
{
MoveObject(portao2, 1321.073242, -816.034363, 71.719040, 0.0000, 0.0000, 270.0000, 5);
SendClientMessage(playerid, 0xAA3333AA, "Portao aberto" );
portao2info = 1;
}
else if(portao2info == 2)
{
MoveObject(portao2,1321.094360, -824.628906, 72.697807, 0.0000, 0.0000, 270.0000, 5);
SendClientMessage(playerid, 0xAA3333AA, "Portao fechado" );
portao2info = 0;
}
return 1;
}
return 0;
}

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 OnPlayerRequestSpawn(playerid)
{
return 1;
}

public OnObjectMoved(objectid)
{
return 1;
}

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

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

public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}

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

public OnPlayerExitedMenu(playerid)
{
return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}

public OnPlayerUpdate(playerid)
{
return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
#endif

Valew deu certinho obrigado
Reply
#4

A do redkill esta bom, mas ele errou em mts coisas.

1є Caso seja um FS nгo coloque objetos no OnGameModeInit mas sim no OnFilterScriptInit
2є Nгo use #if defined FILTERSCRIPT mas sim #define FILTERSCRIPT, pois assim nгo irб bugar o seu FS.
3є nem precisa de usar essas calbacks todas.
4є Se vocк quiser use o meu

pawn Код:
#include <a_samp>
#define FILTERSCRIPT
new
    portao2info[MAX_PLAYERS],
    portaoinfo[MAX_PLAYERS],
    portao2,
    portao
;
public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Movendo Gates");
    print("--------------------------------------\n");
    portao = CreateObject(976, 1241.124268, -767.295837, 91.218994, 0.0000, 0.0000, 0.0000);
    portao2 = CreateObject(976, 1241.124268, -767.295837, 91.218994, 0.0000, 0.0000, 0.0000);
    CreateObject(3502, 1249.388428, -730.477478, 92.170258, 0.0000, 0.0000, 22.5000);
    CreateObject(976, 1241.124268, -767.295837, 91.218994, 0.0000, 0.0000, 0.0000);
    CreateObject(976, 1321.073242, -816.034363, 71.719040, 0.0000, 0.0000, 270.0000);
    CreateObject(976, 1321.094360, -824.628906, 72.697807, 0.0000, 0.0000, 270.0000);
    CreateObject(976, 1249.876587, -767.324585, 91.247070, 0.0000, 0.0000, 0.0000);
    CreateObject(987, 1281.393311, -841.984192, 74.470345, 0.0000, 0.0000, 0.0000);
    CreateObject(987, 1269.449341, -841.986938, 74.543274, 0.0000, 0.0000, 0.0000);
    CreateObject(987, 1258.083618, -844.195374, 73.307709, 0.0000, 0.0000, 11.2500);
    CreateObject(987, 1246.561157, -846.469116, 72.836838, 0.0000, 0.0000, 11.2500);
    CreateObject(987, 1234.961548, -847.827148, 72.273499, 0.0000, 0.0000, 6.9528);
    CreateObject(987, 1223.282837, -849.283813, 72.326218, 0.0000, 0.0000, 6.9528);
    CreateObject(987, 1211.899902, -850.671875, 74.311050, 0.0000, 0.0000, 6.9528);
    CreateObject(987, 1202.645630, -843.254089, 74.444283, 0.0000, 0.0000, 321.9528);
    CreateObject(987, 1199.622925, -841.073303, 78.422272, 0.0000, 0.0000, 321.9528);
    CreateObject(987, 1198.329468, -829.405884, 78.259323, 0.0000, 0.0000, 276.9528);
    CreateObject(987, 1199.167480, -817.754150, 78.479889, 0.0000, 0.0000, 265.7028);
    CreateObject(987, 1199.751709, -806.245728, 79.844101, 0.0000, 0.0000, 265.7028);
    CreateObject(987, 1204.979736, -795.702026, 80.355789, 0.0000, 0.0000, 243.2028);
    CreateObject(987, 1206.531738, -792.833313, 83.751404, 0.0000, 0.0000, 243.2028);
    CreateObject(987, 1210.234497, -785.275391, 86.145874, 0.0000, 0.0000, 243.2028);
    CreateObject(987, 1214.964600, -775.903809, 87.293411, 0.0000, 0.0000, 243.2028);
    CreateObject(987, 1218.951294, -768.025085, 89.717949, 0.0000, 0.0000, 243.2028);
    CreateObject(987, 1230.788086, -766.694153, 90.585732, 0.0000, 0.0000, 186.9528);
    CreateObject(987, 1239.848389, -766.810181, 89.309624, 0.0000, 0.0000, 180.0000);
    CreateObject(987, 1239.832153, -766.831543, 93.911392, 0.0000, 0.0000, 180.0000);
    CreateObject(3749, 1245.755371, -767.332153, 97.009697, 0.0000, 0.0000, 0.0000);
    CreateObject(984, 1245.777954, -767.320618, 95.271416, 0.0000, 0.0000, 90.0000);
    CreateObject(987, 1267.392822, -767.416016, 91.063705, 0.0000, 0.0000, 180.0000);
    CreateObject(987, 1293.032593, -841.669556, 74.229248, 0.0000, 0.0000, 33.7500);
    CreateObject(987, 1302.385620, -835.257813, 73.957123, 0.0000, 0.0000, 33.7500);
    CreateObject(987, 1310.075073, -830.130066, 73.997475, 0.0000, 0.0000, 22.5000);
    CreateObject(3749, 1320.497925, -821.272705, 77.990555, 0.0000, 0.0000, 90.0000);
    CreateObject(987, 1320.340576, -810.664673, 77.054626, 0.0000, 0.0000, 90.0000);
    CreateObject(987, 1320.251953, -799.893433, 78.485519, 0.0000, 0.0000, 90.0000);
    CreateObject(987, 1320.399780, -793.894226, 83.275848, 0.0000, 0.0000, 90.0000);
    CreateObject(987, 1320.445190, -782.075867, 86.160568, 0.0000, 0.0000, 90.0000);
    CreateObject(987, 1320.373535, -779.419800, 90.600830, 0.0000, 0.0000, 90.0000);
    CreateObject(987, 1320.376465, -767.454102, 90.999146, 0.0000, 0.0000, 180.0000);
    CreateObject(987, 1308.292969, -767.515808, 90.987160, 0.0000, 0.0000, 180.0000);
    CreateObject(987, 1296.329834, -767.560486, 90.971008, 0.0000, 0.0000, 180.0000);
    CreateObject(987, 1284.452881, -767.397339, 91.380325, 0.0000, 0.0000, 180.0000);
    CreateObject(987, 1272.689819, -767.522644, 91.006126, 0.0000, 0.0000, 180.0000);
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/casap", cmdtext, true, 3)== 0)
    {
        if(portaoinfo[playerid] == 0)
        {
            MoveObject(portao, 1241.124268, -767.295837, 91.218994, 5.0);
            SendClientMessage(playerid, 0xAA3333AA, "Portao aberto" );
            portaoinfo[playerid] = 1;
        }
        else if(portaoinfo[playerid] == 1)
        {
            MoveObject(portao,1249.876587, -767.324585, 91.247070, 5.0);
            SendClientMessage(playerid, 0xAA3333AA, "Portao fechado" );
            portaoinfo[playerid] = 0;
        }
        return true;
    }
    if (strcmp("/casapp", cmdtext, true, 3)== 0)
    {
        if(portao2info[playerid] == 0)
        {
            MoveObject(portao2, 1321.073242, -816.034363, 71.719040, 5.0);
            SendClientMessage(playerid, 0xAA3333AA, "Portao aberto" );
            portao2info[playerid] = 1;
        }
        else
        {
            MoveObject(portao2,1321.094360, -824.628906, 72.697807, 5.0);
            SendClientMessage(playerid, 0xAA3333AA, "Portao fechado" );
            portao2info[playerid] = 0;
        }
        return true;
    }
    return false;
}
Alteraзхes:

Код:
Arrays Fixadas - Adicionei o [MAX_PLAYERS] e [playerid] porque se vocк nгo usar isso ele irб setar o valor para todos os players, com o [playerid] irб setar sу para o player que inicia o comando.
Callbacks Deletadas - Existia callbacks sem qualquer motivo
MoveObject Editado - Vocк tinha colocado вngulos e nгo pode colocar
#if defined Filterscript Retirado - apos reitrar isso veio muitos erros, logo fixei eles :D
Adicionado #define FILTERSCRIPT - Adicionei o #define FILTERSCRIPT para o servidor reconhecer que o script й um FILTERSCRIPT :D
Reply
#5

Quote:
Originally Posted by BlueX
Посмотреть сообщение
A do redkill esta bom, mas ele errou em mts coisas.

1є Caso seja um FS nгo coloque objetos no OnGameModeInit mas sim no OnFilterScriptInit
2є Nгo use #if defined FILTERSCRIPT mas sim #define FILTERSCRIPT, pois assim nгo irб bugar o seu FS.
3є nem precisa de usar essas calbacks todas.
4є Se vocк quiser use o meu

pawn Код:
#include <a_samp>
#define FILTERSCRIPT
new
    portao2info[MAX_PLAYERS],
    portaoinfo[MAX_PLAYERS],
    portao2,
    portao
;
public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Movendo Gates");
    print("--------------------------------------\n");
    portao = CreateObject(976, 1241.124268, -767.295837, 91.218994, 0.0000, 0.0000, 0.0000);
    portao2 = CreateObject(976, 1241.124268, -767.295837, 91.218994, 0.0000, 0.0000, 0.0000);
    CreateObject(3502, 1249.388428, -730.477478, 92.170258, 0.0000, 0.0000, 22.5000);
    CreateObject(976, 1241.124268, -767.295837, 91.218994, 0.0000, 0.0000, 0.0000);
    CreateObject(976, 1321.073242, -816.034363, 71.719040, 0.0000, 0.0000, 270.0000);
    CreateObject(976, 1321.094360, -824.628906, 72.697807, 0.0000, 0.0000, 270.0000);
    CreateObject(976, 1249.876587, -767.324585, 91.247070, 0.0000, 0.0000, 0.0000);
    CreateObject(987, 1281.393311, -841.984192, 74.470345, 0.0000, 0.0000, 0.0000);
    CreateObject(987, 1269.449341, -841.986938, 74.543274, 0.0000, 0.0000, 0.0000);
    CreateObject(987, 1258.083618, -844.195374, 73.307709, 0.0000, 0.0000, 11.2500);
    CreateObject(987, 1246.561157, -846.469116, 72.836838, 0.0000, 0.0000, 11.2500);
    CreateObject(987, 1234.961548, -847.827148, 72.273499, 0.0000, 0.0000, 6.9528);
    CreateObject(987, 1223.282837, -849.283813, 72.326218, 0.0000, 0.0000, 6.9528);
    CreateObject(987, 1211.899902, -850.671875, 74.311050, 0.0000, 0.0000, 6.9528);
    CreateObject(987, 1202.645630, -843.254089, 74.444283, 0.0000, 0.0000, 321.9528);
    CreateObject(987, 1199.622925, -841.073303, 78.422272, 0.0000, 0.0000, 321.9528);
    CreateObject(987, 1198.329468, -829.405884, 78.259323, 0.0000, 0.0000, 276.9528);
    CreateObject(987, 1199.167480, -817.754150, 78.479889, 0.0000, 0.0000, 265.7028);
    CreateObject(987, 1199.751709, -806.245728, 79.844101, 0.0000, 0.0000, 265.7028);
    CreateObject(987, 1204.979736, -795.702026, 80.355789, 0.0000, 0.0000, 243.2028);
    CreateObject(987, 1206.531738, -792.833313, 83.751404, 0.0000, 0.0000, 243.2028);
    CreateObject(987, 1210.234497, -785.275391, 86.145874, 0.0000, 0.0000, 243.2028);
    CreateObject(987, 1214.964600, -775.903809, 87.293411, 0.0000, 0.0000, 243.2028);
    CreateObject(987, 1218.951294, -768.025085, 89.717949, 0.0000, 0.0000, 243.2028);
    CreateObject(987, 1230.788086, -766.694153, 90.585732, 0.0000, 0.0000, 186.9528);
    CreateObject(987, 1239.848389, -766.810181, 89.309624, 0.0000, 0.0000, 180.0000);
    CreateObject(987, 1239.832153, -766.831543, 93.911392, 0.0000, 0.0000, 180.0000);
    CreateObject(3749, 1245.755371, -767.332153, 97.009697, 0.0000, 0.0000, 0.0000);
    CreateObject(984, 1245.777954, -767.320618, 95.271416, 0.0000, 0.0000, 90.0000);
    CreateObject(987, 1267.392822, -767.416016, 91.063705, 0.0000, 0.0000, 180.0000);
    CreateObject(987, 1293.032593, -841.669556, 74.229248, 0.0000, 0.0000, 33.7500);
    CreateObject(987, 1302.385620, -835.257813, 73.957123, 0.0000, 0.0000, 33.7500);
    CreateObject(987, 1310.075073, -830.130066, 73.997475, 0.0000, 0.0000, 22.5000);
    CreateObject(3749, 1320.497925, -821.272705, 77.990555, 0.0000, 0.0000, 90.0000);
    CreateObject(987, 1320.340576, -810.664673, 77.054626, 0.0000, 0.0000, 90.0000);
    CreateObject(987, 1320.251953, -799.893433, 78.485519, 0.0000, 0.0000, 90.0000);
    CreateObject(987, 1320.399780, -793.894226, 83.275848, 0.0000, 0.0000, 90.0000);
    CreateObject(987, 1320.445190, -782.075867, 86.160568, 0.0000, 0.0000, 90.0000);
    CreateObject(987, 1320.373535, -779.419800, 90.600830, 0.0000, 0.0000, 90.0000);
    CreateObject(987, 1320.376465, -767.454102, 90.999146, 0.0000, 0.0000, 180.0000);
    CreateObject(987, 1308.292969, -767.515808, 90.987160, 0.0000, 0.0000, 180.0000);
    CreateObject(987, 1296.329834, -767.560486, 90.971008, 0.0000, 0.0000, 180.0000);
    CreateObject(987, 1284.452881, -767.397339, 91.380325, 0.0000, 0.0000, 180.0000);
    CreateObject(987, 1272.689819, -767.522644, 91.006126, 0.0000, 0.0000, 180.0000);
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/casap", cmdtext, true, 3)== 0)
    {
        if(portaoinfo[playerid] == 0)
        {
            MoveObject(portao, 1241.124268, -767.295837, 91.218994, 5.0);
            SendClientMessage(playerid, 0xAA3333AA, "Portao aberto" );
            portaoinfo[playerid] = 1;
        }
        else if(portaoinfo[playerid] == 1)
        {
            MoveObject(portao,1249.876587, -767.324585, 91.247070, 5.0);
            SendClientMessage(playerid, 0xAA3333AA, "Portao fechado" );
            portaoinfo[playerid] = 0;
        }
        return true;
    }
    if (strcmp("/casapp", cmdtext, true, 3)== 0)
    {
        if(portao2info[playerid] == 0)
        {
            MoveObject(portao2, 1321.073242, -816.034363, 71.719040, 5.0);
            SendClientMessage(playerid, 0xAA3333AA, "Portao aberto" );
            portao2info[playerid] = 1;
        }
        else
        {
            MoveObject(portao2,1321.094360, -824.628906, 72.697807, 5.0);
            SendClientMessage(playerid, 0xAA3333AA, "Portao fechado" );
            portao2info[playerid] = 0;
        }
        return true;
    }
    return false;
}
Alteraзхes:

Код:
Arrays Fixadas - Adicionei o [MAX_PLAYERS] e [playerid] porque se vocк nгo usar isso ele irб setar o valor para todos os players, com o [playerid] irб setar sу para o player que inicia o comando.
Callbacks Deletadas - Existia callbacks sem qualquer motivo
MoveObject Editado - Vocк tinha colocado вngulos e nгo pode colocar
#if defined Filterscript Retirado - apos reitrar isso veio muitos erros, logo fixei eles :D
Adicionado #define FILTERSCRIPT - Adicionei o #define FILTERSCRIPT para o servidor reconhecer que o script й um FILTERSCRIPT :D
Vlw BlueX Tambem Nгo So Muito Bom Em Pwn Mesmo й Vivendo e Aprendendo^^
Reply
#6

Sу fiz para ensinar os dois nй
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)