/gotopos | /gotocoords -
iKevin - 01.01.2016
Hello people. I'd like to ask if anybody of you can script a command /gotopos or /gotocoords [x] [y] [z] [int] so i can place interiors on my server. And please tell me how do I put it in.. I just paste it into the GM.pwn and atart it?
Kind regards;
Kevin
Re: /gotopos | /gotocoords -
Crystallize - 01.01.2016
Код:
CMD:gotopos(playerid,params[])
{
new
Float:pos1,
Float:pos2,
int;
if(sscanf(params,"fffd",floatstr(params),pos1,pos2,int)) return SendClientMessage(playerid,color,"USAGE: /gotopos [x] [y] [z] [interiorid]");
if(IsPlayerInAnyVehicle(playerid))
{
SetVehiclePos(GetPlayerVehicleID(playerid),floatstr(params),pos1,pos2);
LinkVehicleToInterior(GetPlayerVehicleID(playerid),int);
}
else
{
SetPlayerPos(playerid,floatstr(params),pos1,pos2);
SetPlayerInterior(playerid,int);
}
return 1;
}
Next time SEARCH.
Re: /gotopos | /gotocoords -
saffierr - 01.01.2016
Here you go
PHP код:
CMD:gotopos(playerid, params[])
{
new string[75], Float:X, Float:Y, Float:Z;
if(sscanf(params, "fff", Float:X, Float:Y, Float:Z)) return SendClientMessage(playerid, -1, "Usage: /gotopos [X-Y-Z]");
SetPlayerPos(playerid, Float:X, Float:Y, Float:Z);
format(string, sizeof string, "You are teleported to position 'X'%f 'Y'%f 'Z'%f", Float:X, Float:Y, Float:Z);
SendClientMessage(playerid, COLOR_LIGHTGREEN, string);
return 1;
}
Re: /gotopos | /gotocoords -
iKevin - 01.01.2016
How do i put this to script then
Re: /gotopos | /gotocoords -
Crystallize - 01.01.2016
Quote:
Originally Posted by KevinExec
How do i put this to script then
|
paste it on ur .pwn
Re: /gotopos | /gotocoords -
iKevin - 01.01.2016
I did and i reuploaded it on the hostsite..gmxed.. not working
Re: /gotopos | /gotocoords -
ThomasEvil - 27.03.2017
Quote:
Originally Posted by saffierr
Here you go
PHP код:
CMD:gotopos(playerid, params[])
{
new string[75], Float:X, Float:Y, Float:Z;
if(sscanf(params, "fff", Float:X, Float:Y, Float:Z)) return SendClientMessage(playerid, -1, "Usage: /gotopos [X-Y-Z]");
SetPlayerPos(playerid, Float:X, Float:Y, Float:Z);
format(string, sizeof string, "You are teleported to position 'X'%f 'Y'%f 'Z'%f", Float:X, Float:Y, Float:Z);
SendClientMessage(playerid, COLOR_LIGHTGREEN, string);
return 1;
}
|
What if i want to use /gotopos 0,0,0
instead of /gotopos 0 0 0
Please?
Re: /gotopos | /gotocoords -
Dayrion - 27.03.2017
Quote:
Originally Posted by ThomasEvil
What if i want to use /gotopos 0,0,0
instead of /gotopos 0 0 0
Please?
|
It will not work. sscanf is looking in your string 3 float values. 0,0,0 isn't a value. That's why.
Re: /gotopos | /gotocoords -
Unte99 - 27.03.2017
Quote:
Originally Posted by Dayrion
It will not work. sscanf is looking in your string 3 float values. 0,0,0 isn't a value. That's why.
|
Put this in your gamemode and see if using the command as /coordinates 0 0 0 works:
pawn Код:
CMD:coordinates(playerid, params[])
{
new Float:x,Float:y,Float:z;
if(!sscanf(params, "fff",x,y,z))
SetPlayerPos(playerid, x,y,z);
return 1;
}
Re: /gotopos | /gotocoords -
Dayrion - 27.03.2017
Quote:
Originally Posted by Unte99
Put this in your gamemode and see if using the command as /coordinates 0 0 0 works:
pawn Код:
CMD:coordinates(playerid, params[]) { new Float:x,Float:y,Float:z; if(!sscanf(params, "fff",x,y,z)) SetPlayerPos(playerid, x,y,z); return 1; }
|
Yes... Try with 0,0,0