[UnSovled] /Coord Command Saving To File
#8

pawn Код:
#include Dini.inc
OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/coord", cmdtext, true, 6) == 0)
{
if(!IsPlayerInAnyVehicle(playerid)){SendClientMessage(playerid,0xff0000aa,"You must be in a vehicle!"); return 1;}
new t = playerid;
new str[256], file[256], name[MAX_PLAYER_NAME];
new Float:Pos[MAX_PLAYERS][4];
GetPlayerPos(t,Pos[t][0],Pos[t][1],Pos[t][2]);
GetPlayerFacingAngle(t,Pos[t][3]);
GetPlayerName(playerid, name, MAX_PLAYER_NAME);

format(str, 256,"x= %.4f y= %.4f z= %.4f a= %.4f",Pos[t][0],Pos[t][1],Pos[t][2],Pos[t][3]); // you won't need that.
SendClientMessage(playerid, 0xFF0000AA, "Thank You Your Coords And Vehicle ID Have Ben Saved");
format(file,256,"userpos/%s.ini",name);
if(!dini_Exists(file)){ dini_Create(file);}
dini_FloatSet(file,"x",Pos[t][0]);
dini_FloatSet(file,"y",Pos[t][1]);
dini_FloatSet(file,"z",Pos[t][2]);
dini_FloatSet(file,"a",Pos[t][3]);
dini_IntSet(file,"vehid",GetPlayerVehicleID(playerid));
return 1;
}
return 1;
}
That should help you (Dini rocks! )
Reply


Messages In This Thread
[UnSovled] /Coord Command Saving To File - by fsnameless - 28.12.2009, 05:23
Re: [Question] Creating A file - by dice7 - 28.12.2009, 08:43
Re: [Question] Creating A file - by fsnameless - 28.12.2009, 21:36
Re: [Question] Creating A file - by Abernethy - 28.12.2009, 21:39
Re: [Question] Creating A file - by dice7 - 28.12.2009, 22:06
Re: [Question] Creating A file - by fsnameless - 28.12.2009, 22:09
Re: [Question] Creating A file - by fsnameless - 29.12.2009, 00:05
Re: [Question] Creating A file - by xspeedasx - 29.12.2009, 07:19
Re: [Question] Creating A file - by retart441 - 29.12.2009, 07:21
Re: [Question] Creating A file - by dice7 - 29.12.2009, 08:55

Forum Jump:


Users browsing this thread: 2 Guest(s)