04.08.2011, 02:45
how can i create a command for example /mypos and shows you ur x y and z postion (needed to crate objects ingame) cuz its a pain in the @$$ to be doing /save all the time plz hellp...
new Float:Pos[3],string[32];
GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
format(string,sizeof(string),"%f %f %f",Pos[0],Pos[1],Pos[2]);
SendClientMessage(playerid,0xFFFFFF,string);
how can i create a command for example /mypos and shows you ur x y and z postion (needed to crate objects ingame) cuz its a pain in the @$$ to be doing /save all the time plz hellp...
|
if(strcmp(cmd, "/getpos", true) == 0 || strcmp(cmd, "/getposition", true) == 0)
{
new StrGetPos[150], Float:X, Float:Z, Float:Y;
GetPlayerPos(playerid, X, Y, Z);
format(StrGetPos, sizeof(StrGetPos),"Your Current Position: {0080FF}%f, %f, %f,", X, Y, Z);
SendClientMessage(playerid, COLOR_WHITE, StrGetPos);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/getpos", cmdtext, true, 10) == 0)
{
new StrGetPos[150], Float:X, Float:Z, Float:Y;
GetPlayerPos(playerid, X, Y, Z);
format(StrGetPos, sizeof(StrGetPos),"Your Current Position: {0080FF}%f, %f, %f,", X, Y, Z);
SendClientMessage(playerid, COLOR_WHITE, StrGetPos);
return 1;
}
return 0;
}