12.11.2015, 07:03
The script
error line
The problem...It says it's not defined but it is...wtf?
PHP код:
//***************************xxxSpeedxxx's DM ARENA FS**************************
//#define FILTERSCRIPT
#include <a_samp>
#if defined FILTERSCRIPT
new InDM[MAX_PLAYERS];
new Dead[MAX_PLAYERS];
#define COLOR_GREEN 0x33AA33AA
#define COLOR_WHITE 0xFFFFFFFF
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" DM Arena by xxxSpeedxxx");
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;
}
//STOCK
stock GetName(playerid)
{
new pnameid[24];
GetPlayerName(playerid,pnameid,24);
return pnameid;
}
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)
{
InDM[playerid] = 0;
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
return 1;
}
public OnPlayerSpawn(playerid)
{
if(Dead[playerid] == 1)
{
SetPlayerHealth(playerid, 100);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 26, cellmax);
GivePlayerWeapon(playerid, 28, cellmax);
GivePlayerWeapon(playerid, 24, cellmax);
GivePlayerWeapon(playerid, 34, cellmax);
SetPlayerInterior(playerid, 1);
SetPlayerPos(playerid, 1412.639892, -1.787510, 1000.924377);
SetPlayerVirtualWorld(playerid, 1);
SetPlayerSkin(playerid, 167);
Dead[playerid] = 0;
}
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
if(InDM[playerid] == 1)
new msg[120], msg2[120];
format(msg, sizeof(msg), "You killed %s!", GetName(playerid));
format(msg2, sizeof(msg2),"You got killed by %s!", GetName(killerid));
SendClientMessage(playerid, COLOR_GREEN, msg2);
SendClientMessage(killerid, COLOR_GREEN, msg);
SetPlayerHealth(killerid, 100);
SetPlayerSkin(playerid, 167);
Dead[playerid] = 1;
SpawnPlayer(playerid);
SetPlayerInterior(playerid, 1);
SetPlayerPos(playerid, 1412.639892, -1.787510, 1000.924377);
SetPlayerVirtualWorld(playerid, 1);
SetPlayerTeam(playerid, playerid);
GivePlayerWeapon(playerid, 26, cellmax);
GivePlayerWeapon(playerid, 16, 2);
GivePlayerWeapon(playerid, 28, cellmax);
GivePlayerWeapon(playerid, 24, cellmax);
GivePlayerWeapon(playerid, 34, cellmax);
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
CMD:exitdm(playerid, params[])
{
if(InDM[playerid] == 0)
{
SendClientMessage(playerid, -1, "You are not at the DM arena!");
return 1;
}
else if(InDM[playerid] == 1)
{
InDM[playerid] = 0;
SetPlayerVirtualWorld(playerid, 0);
SetPlayerHealth(playerid, 0.00);
ForceClassSelection(playerid);
SetPlayerInterior(playerid, 0);
SendClientMessage(playerid, -1, "You have left the DM arena!");
return 1;
}
}
CMD:enterdm(playerid, params[])
{
InDM[playerid] = 1; // we declared him in the DM arena.
GameTextForPlayer(playerid, "/exitdm to exit!", 3000, 4); // a little game text to tell him how to exit if he's bored from the arena.
SendClientMessage(playerid, -1, "{66FF66}Welcome to the deathmatch arena! {BABABA}"); // Welcoming him to the arena..
SetPlayerInterior(playerid, 1); // setting his interior to 1
SetPlayerPos(playerid, 1412.639892, -1.787510, 1000.924377); // aswell as his position
SetPlayerVirtualWorld(playerid, 1); // and virtual world :D
SetPlayerTeam(playerid, playerid); // setting every player in a team, since every one has a unique playerid
ResetPlayerWeapons(playerid); // removing his weapons from outside the arena
SetPlayerColor(playerid, COLOR_WHITE); // setting everyone's color to white, u can change it
SetPlayerSkin(playerid, 167); // setting his funny skin
SetPlayerHealth(playerid, 100); // 100 for the health
SetPlayerArmour(playerid, 100); // 100 armour
GivePlayerWeapon(playerid, 26, cellmax);
GivePlayerWeapon(playerid, 28, cellmax);
GivePlayerWeapon(playerid, 24, cellmax);
GivePlayerWeapon(playerid, 34, cellmax);
GivePlayerWeapon(playerid, 16, 2); // we gave him the weapons here.
new str[200], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(str, sizeof(str), "{FFFFFF}%s {BABABA}(ID: %d) has entered the DM arena! Join him using /enterdm !", name, playerid);
SendClientMessageToAll(-1, str);// we just announced to everyone that he entered the arena
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 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;
}
Код:
public OnPlayerConnect(playerid) { InDM[playerid] = 0; return 1; }
Код:
C:\Users\Speed\Desktop\DM ARENA.pwn(69) : error 017: undefined symbol "InDM" C:\Users\Speed\Desktop\DM ARENA.pwn(69) : warning 215: expression has no effect C:\Users\Speed\Desktop\DM ARENA.pwn(69) : error 001: expected token: ";", but found "]" C:\Users\Speed\Desktop\DM ARENA.pwn(69) : error 029: invalid expression, assumed zero C:\Users\Speed\Desktop\DM ARENA.pwn(69) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.