23.01.2010, 19:06
si entendi bien lo que vos queres, podes hacer algo asi:
debajo de los includes:
espero que ahora te sirva si no avisame
debajo de los includes:
pawn Код:
new Float:afkX[MAX_PLAYERS];
new Float:afkY[MAX_PLAYERS];
new Float:afkZ[MAX_PLAYERS];
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/afk", cmdtext, true) == 0){
new name[MAX_PLAYER_NAME], string[128];
TogglePlayerControllable(playerid, 0);
GetPlayerPos(playerid, afkX[playerid], afkY[playerid], afkZ[playerid]);
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s esta ausente por ahora", name);
GameTextForAll(string, 3000, 5);
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}
if (strcmp("/back", cmdtext, true) == 0){
new name[MAX_PLAYER_NAME], string[128];
TogglePlayerControllable(playerid, 1);
GetPlayerName(playerid, name, sizeof(name));
SetPlayerPos(playerid, afkX[playerid], afkY[playerid], afkZ[playerid]);
format(string, sizeof(string), "%s ha vuelto", name);
GameTextForAll(string, 3000, 5);
SetCameraBehindPlayer(playerid);
return 1;
}
return 0;
}