23.07.2012, 10:47
pawn Код:
CMD:saveonfoot(playerid, params[])
{
if(gPlayerLoggedIn[playerid] == 0) return 1;
if(KasutajaInfo[playerid][kAdmin] < 3) {
SendClientMessage(playerid, COLOR_LIGHTRED, "CMD: You are not authorized to use this command, I am sorry.");
return 1;
}
if(!isnull(params)) {
new string[256];
new File:onfoot=fopen("onfootpositions.txt", io_append);
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
new Float:A;
GetPlayerFacingAngle(playerid, A);
format(string, sizeof(string), "SetPlayerPos(playerid, %f, %f, %f); \r\nSetPlayerFacingAngle(playerid, %f);// %s \r\n\r\n\r\n", X, Y, Z, A, params);
fwrite(onfoot, string);
fclose(onfoot);
SendClientMessage(playerid, COLOR_LIGHTRED, "* You have saved your on foot position.");
return 1;
}
else {SendClientMessage(playerid, COLOR_GREY, "* Must add a comment.");}
return 1;
}