19.11.2011, 12:43
Can you help me with: /spec(tate) ; /speclist and /specoff please ? I use GodFather
#include <a_samp>
#include <zcmd>
// Defines
#define SPEC_NONE 0
#define SPEC_PLAYER 1
#define SPEC_VEHICLE 2
// Variables
new
gSpectateType[MAX_PLAYERS], gSpectateID[MAX_PLAYERS];
CMD:spec(playerid, params[])
{
new
giveid;
if(sscanf(params, "r", giveid)) return SendClientMessage(playerid, RED, "[ERROR]: Usage: /spec playerid>");
else if(giveid == INVALID_PLAYER_ID) return SendClientMessage(playerid, RED, "[ERROR]: That player isn't online!");
else {
if(IsPlayerInAnyVehicle(giveid)) {
TogglePlayerSpectating(playerid, 1);
PlayerSpectateVehicle(playerid, GetPlayerVehicleID(giveid));
gSpectateID[playerid] = giveid;
gSpectateType[playerid] = SPEC_VEHICLE;
}
else {
TogglePlayerSpectating(playerid, 1);
PlayerSpectatePlayer(playerid, giveid);
gSpectateID[playerid] = giveid;
gSpectateType[playerid] = SPEC_PLAYER;
}
}
return 1;
}
CMD:specoff(playerid, params[])
{
TogglePlayerSpectating(playerid, 0);
gSpectateID[playerid] = INVALID_PLAYER_ID;
gSpectateType[playerid] = SPEC_NONE;
return 1;
}