17.08.2011, 16:59
above problem solved but here is new one
here is my code of afk system but now the problem is that when i type /afk it teleport me to interior that i want but on chat box there is written unknown command
and another thing when i type /back it doesnt teleport me to my place where i typed afk. it teleports me in air and player goes through ground
pawn Код:
CMD:afk(playerid, params[])
{
new
Float:LastX[ MAX_PLAYERS ],
Float:LastY[ MAX_PLAYERS ],
Float:LastZ[ MAX_PLAYERS ];
GetPlayerPos(playerid, LastX[ playerid ], LastY[ playerid ], LastZ[ playerid ]);
SetPlayerPos(playerid,2324.419921,-1145.568359,1050.710083);
SetPlayerInterior(playerid, 12);
SendClientMessage(playerid, COLOR_YELLOW, "You are now AFK, type /back to move again!");
TogglePlayerControllable(playerid,0);
label[playerid] = Create3DTextLabel("AFK",COLOR_YELLOW,30.0,40.0,50.0,40.0,0);
Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.7);
new string3[70];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string3, sizeof(string3), "%s is now Away from the keyboard!", name);
SendClientMessageToAll(COLOR_YELLOW, string3);
}
CMD:back(playerid, params[])
{
new
Float:LastX[ MAX_PLAYERS ],
Float:LastY[ MAX_PLAYERS ],
Float:LastZ[ MAX_PLAYERS ];
SetPlayerPos(playerid, LastX[ playerid ], LastY[ playerid ], LastZ[ playerid ]);
SetPlayerInterior(playerid, 0);
SendClientMessage(playerid, COLOR_YELLOW, "You are now back!");
TogglePlayerControllable(playerid,1);
new string3[70];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string3, sizeof(string3), "%s is now Back!", name);
SendClientMessageToAll(COLOR_YELLOW, string3);
Delete3DTextLabel(Text3D:label[playerid]);
return 1;
}
and another thing when i type /back it doesnt teleport me to my place where i typed afk. it teleports me in air and player goes through ground