#include <a_samp>
//------------------------------------------------------------------------------
#define KILLER_SPEC_TYPE_PLAYER 0
#define KILLER_SPEC_TYPE_NONE 1
//------------------------------------------------------------------------------
new gSpectateID[MAX_PLAYERS];
new gSpectateType[MAX_PLAYERS];
new CountdownTime = 10,CountdownTimer,CTime;
forward Countdown();
//------------------------------------------------------------------------------
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
new x = 0;
while(x!=MAX_PLAYERS) {
if( IsPlayerConnected(x) && GetPlayerState(x) == PLAYER_STATE_SPECTATING &&
gSpectateID[x] == playerid && gSpectateType[x] == KILLER_SPEC_TYPE_PLAYER )
{
SetPlayerInterior(x,newinteriorid);
}
x++;
}
}
//------------------------------------------------------------------------------
public OnPlayerDeath(playerid, killerid, reason)
{
new speckillerid;
TogglePlayerSpectating(playerid, 1);
PlayerSpectatePlayer(playerid, speckillerid);
SetPlayerInterior(playerid,GetPlayerInterior(speckillerid));
gSpectateID[playerid] = speckillerid;
gSpectateType[playerid] = KILLER_SPEC_TYPE_PLAYER;
return 1;
}
//------------------------------------------------------------------------------
public Countdown()
{
new playerid;
CountdownTimer = SetTimer("Countdown",1000,1);
CTime = CountdownTime;
if(CTime == 0) {
CTime = CountdownTime;
KillTimer(CountdownTimer); }
CTime--;
TogglePlayerSpectating(playerid, 0);
gSpectateID[playerid] = INVALID_PLAYER_ID;
gSpectateType[playerid] = KILLER_SPEC_TYPE_NONE;
}
Originally Posted by Seif_
First: OnPlayerDeath doesn't only have playerid. Check again.
Second: you're defining speckillerid, which is automatically set as 0. |
C:\Users\Arnoldziux\Documents\Top Secret\Serveris\filterscripts\adminspec.pwn(30) : error 017: undefined symbol "speckillerid"
C:\Users\Arnoldziux\Documents\Top Secret\Serveris\filterscripts\adminspec.pwn(31) : error 017: undefined symbol "speckillerid"
C:\Users\Arnoldziux\Documents\Top Secret\Serveris\filterscripts\adminspec.pwn(32) : error 017: undefined symbol "speckillerid"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
3 Errors.
Originally Posted by Seif_
Defining a variable like that won't find the killer magically. Press New button in PAWN and look at OnPlayerDeath.
|
Originally Posted by [SLR
Assassin ]
Quote:
I get a blank page |
Originally Posted by -=[Serbish
=- ]
Quote:
That could help you. |
Originally Posted by Seif_
Quote:
Quote:
|
#include <a_samp>
//------------------------------------------------------------------------------
#define KILLER_SPEC_TYPE_PLAYER 0
#define KILLER_SPEC_TYPE_NONE 1
//------------------------------------------------------------------------------
new gSpectateID[MAX_PLAYERS];
new gSpectateType[MAX_PLAYERS];
new CountdownTime = 15,CountdownTimer,CTime;
forward Countdown();
//------------------------------------------------------------------------------
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
new x = 0;
while(x!=MAX_PLAYERS) {
if( IsPlayerConnected(x) && GetPlayerState(x) == PLAYER_STATE_SPECTATING &&
gSpectateID[x] == playerid && gSpectateType[x] == KILLER_SPEC_TYPE_PLAYER )
{
SetPlayerInterior(x,newinteriorid);
}
x++;
}
}
//------------------------------------------------------------------------------
public OnPlayerSpawn(playerid)
{
new speckillerid;
TogglePlayerSpectating(playerid, 1);
PlayerSpectatePlayer(playerid, speckillerid);
SetPlayerInterior(playerid,GetPlayerInterior(speckillerid));
gSpectateID[playerid] = speckillerid;
gSpectateType[playerid] = KILLER_SPEC_TYPE_PLAYER;
return 1;
}
//------------------------------------------------------------------------------
public Countdown()
{
new playerid;
CountdownTimer = SetTimer("Countdown",1000,1);
CTime = CountdownTime;
if(CTime == 0) {
CTime = CountdownTime;
KillTimer(CountdownTimer); }
CTime--;
TogglePlayerSpectating(playerid, 0);
gSpectateID[playerid] = INVALID_PLAYER_ID;
gSpectateType[playerid] = KILLER_SPEC_TYPE_NONE;
}
Originally Posted by Jump3r
Quote:
it gives me errors like pawn Код:
|
//------------------------------------------------------------------------------ #define KILLER_SPEC_TYPE_PLAYER 0 #define KILLER_SPEC_TYPE_NONE 1 //------------------------------------------------------------------------------ new gSpectateID[MAX_PLAYERS]; new gSpectateType[MAX_PLAYERS]; new CountdownTime = 15,CountdownTimer,CTime; forward Countdown(); //------------------------------------------------------------------------------ public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid) { new x = 0; while(x!=MAX_PLAYERS) { if( IsPlayerConnected(x) && GetPlayerState(x) == PLAYER_STATE_SPECTATING && gSpectateID[x] == playerid && gSpectateType[x] == KILLER_SPEC_TYPE_PLAYER ) { SetPlayerInterior(x,newinteriorid); } x++; } } //------------------------------------------------------------------------------ public OnPlayerSpawn(playerid) { new speckillerid; TogglePlayerSpectating(playerid, 1); PlayerSpectatePlayer(playerid, speckillerid); SetPlayerInterior(playerid,GetPlayerInterior(speckillerid)); gSpectateID[playerid] = speckillerid; gSpectateType[playerid] = KILLER_SPEC_TYPE_PLAYER; return 1; } //------------------------------------------------------------------------------ public Countdown() { new playerid; CountdownTimer = SetTimer("Countdown",1000,1); CTime = CountdownTime; if(CTime == 0) { CTime = CountdownTime; KillTimer(CountdownTimer); } CTime--; TogglePlayerSpectating(playerid, 0); gSpectateID[playerid] = INVALID_PLAYER_ID; gSpectateType[playerid] = KILLER_SPEC_TYPE_NONE; }