19.10.2010, 18:43
(
Последний раз редактировалось HigorOliverr; 19.10.2010 в 18:59.
)
No topo
em onplayercommandtext:
pawn Код:
new TVID[MAX_PLAYERS];
new TVIID[MAX_PLAYERS];
pawn Код:
new tvid;
new cmd;
if(!IsPlayerAdmin(playerid)) return 0;
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, "/tv", true) == 0) {
new tmp[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /tv [playerid]");
return 1;
}
tvid = strval(tmp);
if(!IsPlayerConnected(tvid)) {
SendClientMessage(playerid, 0x33AA33AA, "tv: that player isn't active.");
return 1;
}
TogglePlayerSpectating(playerid, 1);
PlayerSpectatePlayer(playerid, tvid);
SetPlayerInterior(playerid,GetPlayerInterior(tvid));
TVID[playerid] = tvid;
TVIID[playerid] = 1;
return 1;
}
if(strcmp(cmd, "/tvoff", true) == 0) {
TogglePlayerSpectating(playerid, 0);
TVID[playerid] = INVALID_PLAYER_ID;
TVIID[playerid] = 0;
return 1;
}