21.11.2011, 14:25
Hey.. I made this cameras but I want that if the player write /camera 3 so he'll be back to the same place he started using the camera.. but for some reason its just dont happen..
pawn Код:
if(strcmp(cmd, "/secam", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pLeader] == 5)
{
if(!PlayerToPoint(8.0,playerid,2329.3135,-1141.5300,1050.4922))
{
SendClientMessage(playerid, COLOR_GREY, " You are not at the HQ Security Panel !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /camera [number 1 - 3] (3 = OFF)");
return 1;
}
new number = strval(tmp);
if(number < 1 || number > 3) { SendClientMessage(playerid, COLOR_GREY, " Camera Number can't be below 1 or above 3 !"); return 1; }
TogglePlayerControllable(playerid, 0);
GetPlayerPos(playerid, Unspec[playerid][Coords][0],Unspec[playerid][Coords][1],Unspec[playerid][Coords][2]);
if(number == 1) { SetPlayerCameraPos(playerid, 311.8736, -1165.4298, 95.1409); SetPlayerCameraLookAt(playerid, 312.1151, -1166.3986, 94.4358); SetPlayerInterior(playerid,0); }
else if(number == 2) { SetPlayerCameraPos(playerid, 291.3331, -1144.8138, 86.9462); SetPlayerCameraLookAt(playerid, 291.4228, -1145.8085, 86.5411); SetPlayerInterior(playerid,0); }
else if(number == 3)
{
TogglePlayerControllable(playerid, 1);
SetSpawnInfo(playerid, PlayerInfo[playerid][pTeam], PlayerInfo[playerid][pModel], Unspec[playerid][Coords][0], Unspec[playerid][Coords][1], Unspec[playerid][Coords][2], 10.0, -1, -1, -1, -1, -1, -1);
SetPlayerInterior(playerid,15);
SetPlayerPos(playerid,2329.3135,-1141.5300,1050.4922);
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You cannot use this command !");
return 1;
}
}
return 1;
}