andreika5552
Новичок
Вырезал из мода команду /spec,и тут вышли ошибки "Spectate" добивил ко всем new>new Spectate[MAX_PLAYERS];
Вышли новая ошибка,как странно 1. Вот такая : error 017: undefined symbol "GetServerMoney"
Вот сама команда :
else if(strcmp(cmd, "/spec", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "Pawno: Для начала авторизируйтесь!");
if(PlayerInfo[playerid][pAdmin] == 0) return SendClientMessage(playerid, COLOR_WHITE, "Pawno: {F42D2D}Ты не можешь использовать эту команду!");
if(Spectate[playerid] == 255 && PlayerInfo[playerid][pLocal] != 255 || Spectate[playerid] == 255 && PlayerInfo[playerid][pAdmin] > 0)
{
GetPlayerPos(playerid, Unspec[playerid][sPx], Unspec[playerid][sPy], Unspec[playerid][sPz]);
Unspec[playerid][sPint] = PlayerInfo[playerid][pInt];
Unspec[playerid][sLocal] = PlayerInfo[playerid][pLocal];
PlayerInfo[playerid][pLocal] = 255;
}
tmp = strtok(cmdtext, idx);
if(strcmp("off", tmp, true, strlen(tmp)) == 0)
{
if(WatchingTV[playerid] == 0) return SendClientMessage(playerid, COLOR_WHITE, "Pawno: {F42D2D}Ты ни за кем не следишь!");
WatchingTV[playerid] = 0;
Spectate[playerid] = 253;
GameTextForPlayer(playerid,"~w~~n~~n~~n~~n~~n~~n~~n~~n~~n~Spec OFF",4000,3);
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
return 1;
}
giveplayerid = ReturnUser(tmp);
if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE, "Pawno: {F42D2D}Этого игрока нет на сервере!");
if(giveplayerid != INVALID_PLAYER_ID)
{
Spectate[playerid] = giveplayerid;
new Float:health;
GetPlayerHealth(Spectate[playerid], health);
GetPlayerName(Spectate[playerid], giveplayer, sizeof(giveplayer));
new cash = GetServerMoney(Spectate[playerid]);
SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(Spectate[playerid]));
SetPlayerInterior(playerid, GetPlayerInterior(Spectate[playerid]));
if (PlayerInfo[playerid][pAdmin] >= 1)
{
format(string, sizeof(string), "Pawno: {F42D2D}Игрок: %s[%d], Деньги: $%d, Жизни: %.0f.",giveplayer,Spectate[playerid],cash,health);
SendClientMessage(playerid, COLOR_WHITE, string);
}
WatchingTV[playerid] = 1;
}
}
return 1;
}
Вышли новая ошибка,как странно 1. Вот такая : error 017: undefined symbol "GetServerMoney"
Вот сама команда :
else if(strcmp(cmd, "/spec", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "Pawno: Для начала авторизируйтесь!");
if(PlayerInfo[playerid][pAdmin] == 0) return SendClientMessage(playerid, COLOR_WHITE, "Pawno: {F42D2D}Ты не можешь использовать эту команду!");
if(Spectate[playerid] == 255 && PlayerInfo[playerid][pLocal] != 255 || Spectate[playerid] == 255 && PlayerInfo[playerid][pAdmin] > 0)
{
GetPlayerPos(playerid, Unspec[playerid][sPx], Unspec[playerid][sPy], Unspec[playerid][sPz]);
Unspec[playerid][sPint] = PlayerInfo[playerid][pInt];
Unspec[playerid][sLocal] = PlayerInfo[playerid][pLocal];
PlayerInfo[playerid][pLocal] = 255;
}
tmp = strtok(cmdtext, idx);
if(strcmp("off", tmp, true, strlen(tmp)) == 0)
{
if(WatchingTV[playerid] == 0) return SendClientMessage(playerid, COLOR_WHITE, "Pawno: {F42D2D}Ты ни за кем не следишь!");
WatchingTV[playerid] = 0;
Spectate[playerid] = 253;
GameTextForPlayer(playerid,"~w~~n~~n~~n~~n~~n~~n~~n~~n~~n~Spec OFF",4000,3);
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
return 1;
}
giveplayerid = ReturnUser(tmp);
if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE, "Pawno: {F42D2D}Этого игрока нет на сервере!");
if(giveplayerid != INVALID_PLAYER_ID)
{
Spectate[playerid] = giveplayerid;
new Float:health;
GetPlayerHealth(Spectate[playerid], health);
GetPlayerName(Spectate[playerid], giveplayer, sizeof(giveplayer));
new cash = GetServerMoney(Spectate[playerid]);
SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(Spectate[playerid]));
SetPlayerInterior(playerid, GetPlayerInterior(Spectate[playerid]));
if (PlayerInfo[playerid][pAdmin] >= 1)
{
format(string, sizeof(string), "Pawno: {F42D2D}Игрок: %s[%d], Деньги: $%d, Жизни: %.0f.",giveplayer,Spectate[playerid],cash,health);
SendClientMessage(playerid, COLOR_WHITE, string);
}
WatchingTV[playerid] = 1;
}
}
return 1;
}
