//==============================================================================
// GPS
//==============================================================================
CMD:gps(playerid,params[]) {
if(PlayerInfo[playerid][Level] >= 3)
return SendClientMessage(playerid,red,"ERROR: You need to be Level 3 to use this Command");
if(PlayerInfo[playerid][SpecType] != ADMIN_SPEC_TYPE_NONE)
return SendClientMessage(playerid, red, "ERROR: First Disable the Spectating System! (/lspecoff)");
if(!strlen(params))
return SendClientMessage(playerid,LIGHTBLUE2, "Usage: /gps [PlayerID/Off]") &&
SendClientMessage(playerid, orange, "Function: Will enable GPS do find a specified Player (If you are in a race, do not use)");
if(strcmp(params,"off",true) == 0)
{
GameTextForPlayer(playerid,"~w~Gps ~r~Off!",3000,3);
Line 14717:IsDisable[playerid] = 0;
PlayerInfo[playerid][pGps] = -1;
return 1;
}
new player1;
new string2[128];
player1 = strval(params);
if(player1 == playerid)
return SendClientMessage(playerid,red,"ERROR: You can not Find yourself!");
if(PlayerInfo[player1][Level] == ServerInfo[MaxAdminLevel] && PlayerInfo[playerid][Level] != ServerInfo[MaxAdminLevel])
return SendClientMessage(playerid,red,"ERROR: You can not localize an Administrator!");
if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID)
{
new playername[MAX_PLAYER_NAME];
GetPlayerName(player1, playername, sizeof(playername));
format(string2, sizeof(string2),"<LuxGps> System Enabled in the Player - '%s'", playername);
SendClientMessage(playerid, 0xDC686BAA, string2);
GameTextForPlayer(playerid,"~w~Gps ~g~On!",3000,3);
PlayerInfo[playerid][pGps] = player1;
}
else return SendClientMessage(playerid,red,"ERROR: Player is not connected);
return 1;
}
C:\Users\Ole Kristian\Desktop\San Andreas Server\gamemodes\SATDM~RP.pwn(14717) : error 028: invalid subscript (not an array or too many subscripts): "IsDisable"
C:\Users\Ole Kristian\Desktop\San Andreas Server\gamemodes\SATDM~RP.pwn(14717) : warning 215: expression has no effect
C:\Users\Ole Kristian\Desktop\San Andreas Server\gamemodes\SATDM~RP.pwn(14717) : error 001: expected token: ";", but found "]"
C:\Users\Ole Kristian\Desktop\San Andreas Server\gamemodes\SATDM~RP.pwn(14717) : error 029: invalid expression, assumed zero
C:\Users\Ole Kristian\Desktop\San Andreas Server\gamemodes\SATDM~RP.pwn(14717) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.
new IsDisable[MAX_PLAYERS];
|
Do you have the variable IsDisable defined at the beggining of your script and also indexed?
pawn Код:
|
//==============================================================================
// GPS
//==============================================================================
CMD:gps(playerid,params[]) {
if(PlayerInfo[playerid][Level] >= 3)
return SendClientMessage(playerid,red,"ERROR: You need to be Level 3 to use this Command");
if(PlayerInfo[playerid][SpecType] != ADMIN_SPEC_TYPE_NONE)
return SendClientMessage(playerid, red, "ERROR: First Disable the Spectating System! (/lspecoff)");
if(!strlen(params))
return SendClientMessage(playerid,LIGHTBLUE2, "Usage: /gps [PlayerID/Off]") &&
SendClientMessage(playerid, orange, "Function: Will enable GPS do find a specified Player (If you are in a race, do not use)");
if(strcmp(params,"off",true) == 0)
{
GameTextForPlayer(playerid,"~w~Gps ~r~Off!",3000,3);
IsDisable[playerid] = 0;
PlayerInfo[playerid][pGps] = -1;
return 1;
}
new player1;
new string2[128];
player1 = strval(params);
if(player1 == playerid)
return SendClientMessage(playerid,red,"ERROR: You can not Find yourself!");
if(PlayerInfo[player1][Level] == ServerInfo[MaxAdminLevel] && PlayerInfo[playerid][Level] != ServerInfo[MaxAdminLevel])
return SendClientMessage(playerid,red,"ERROR: You can not localize an Administrator!");
if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID)
{
new playername[MAX_PLAYER_NAME];
GetPlayerName(player1, playername, sizeof(playername));
format(string2, sizeof(string2),"<LuxGps> System Enabled in the Player - '%s'", playername);
SendClientMessage(playerid, 0xDC686BAA, string2);
GameTextForPlayer(playerid,"~w~Gps ~g~On!",3000,3);
PlayerInfo[playerid][pGps] = player1;
}
else return SendClientMessage(playerid,red,"ERROR: Player is not connected");
return 1;
}
//==============================================================================
// Gps
//==============================================================================
public LuxGpsSys(playerid)
for(new g = 0;g < MAX_PLAYERS; g++)
if(IsPlayerConnected(g))
{
if(PlayerInfo[g][pGps] != -1)
{
if(IsPlayerConnected(PlayerInfo[g][pGps]))
{
new Float:X,
Float:Y,
Float:Z;
new Float:X2,
Float:Y2,
Float:Z2;
new Distance,
LuX_GpsCity[MAX_ZONE_NAME] = "Undetected City!",
LuX_GpsZone[MAX_ZONE_NAME] = "Undetected Zone!";
GetPlayerInCity(PlayerInfo[g][pGps], LuX_GpsCity, MAX_ZONE_NAME);
GetPlayerInZone(PlayerInfo[g][pGps], LuX_GpsZone, MAX_ZONE_NAME);
GetPlayerPos(g, X, Y, Z);
GetPlayerPos(PlayerInfo[g][pGps], X2, Y2, Z2);
Distance = floatround(floatsqroot(floatadd(floatadd(floatpower(floatabs(floatsub(X,X2)),2),floatpower(floatabs(floatsub(Y,Y2)),2)),floatpower(floatabs(floatsub(Z,Z2)),2))));
if(Distance > 6.0)
{
new str[256];
new pname[256];
#if GpsCheckPoint == true
SetPlayerRaceCheckpoint(g, 0, X2, Y2, Z2+2, X2, Y2, Z2-10, 5.0);
#endif
TextDrawShowForPlayer(g, GpsTD[g]);
pname = pName(PlayerInfo[g][pGps]);
pname = strreplace("[", "(", pname); pname = strreplace("[", "(", pname);
pname = strreplace("]", ")", pname); pname = strreplace("]", ")", pname);
#if GpsOnlyCity == true
format(str, 256, "~w~- %s -~n~~n~~b~Distance: ~w~%d ~l~- ~b~Radar: ~w~%s", pname,Distance, LuX_GpsCity);
TextDrawSetString(GpsTD[g], str);
#else
format(str, 256, "~w~- %s -~n~~n~~b~Distance: ~w~%d ~l~- ~b~Radar: ~w~%s (%s)", pname,Distance, LuX_GpsZone, LuX_GpsCity);
TextDrawSetString(GpsTD[g], str);
#endif
}
else
{
#if GpsCheckPoint == true
DisablePlayerRaceCheckpoint(g);
#endif
}
}
else
{
PlayerInfo[g][pGps] = -1;
GameTextForPlayer(g,"~r~Gps Off~n~~g~The Player you used GPS on has left the Server!",3000,3);
}
}
else
{
TextDrawHideForPlayer(g, GpsTD[g]);
if(IsDisable[g] == 0)
#if GpsCheckPoint == true
DisablePlayerRaceCheckpoint(g);
#endif
IsDisable[g] = 1;
}
}
C:\Users\Ole Kristian\Desktop\San Andreas Server\gamemodes\SATDM~RP.pwn(14794) : warning 219: local variable "Distance" shadows a variable at a preceding level
C:\Users\Ole Kristian\Desktop\San Andreas Server\gamemodes\SATDM~RP.pwn(14798) : error 017: undefined symbol "GetPlayerInCity"
C:\Users\Ole Kristian\Desktop\San Andreas Server\gamemodes\SATDM~RP.pwn(14799) : error 017: undefined symbol "GetPlayerInZone"
C:\Users\Ole Kristian\Desktop\San Andreas Server\gamemodes\SATDM~RP.pwn(14809) : error 017: undefined symbol "GpsCheckPoint"
C:\Users\Ole Kristian\Desktop\San Andreas Server\gamemodes\SATDM~RP.pwn(14818) : error 017: undefined symbol "GpsOnlyCity"
C:\Users\Ole Kristian\Desktop\San Andreas Server\gamemodes\SATDM~RP.pwn(14828) : error 017: undefined symbol "GpsCheckPoint"
C:\Users\Ole Kristian\Desktop\San Andreas Server\gamemodes\SATDM~RP.pwn(14843) : error 017: undefined symbol "GpsCheckPoint"
C:\Users\Ole Kristian\Desktop\San Andreas Server\gamemodes\SATDM~RP.pwn(16485) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
7 Errors.
CMD:gps(playerid,params[]){
else return SendClientMessage(playerid,red,"ERROR: Player is not connected");
return 1;
}