24.04.2010, 22:16
pessoal queria saber se tem um jeito de digitar as coordenadas e aparecer o local das coordenadas q vc digito. abraзos.
if(!strcmp(cmdtext, "/pos", true))
{
new idx;
new tmp[256], Float:x, Float:y, z[256], Float:a;
tmp = strtok(cmdtext, idx);
x = floatstr(tmp);
tmp = strtok(cmdtext, idx);
y = floatstr(tmp);
z = strtok(cmdtext, idx);
a = floatstr(strtok(cmdtext, idx));
if(!strlen(tmp))
return SendClientMessage(playerid, 0xFFFFFFAA, "USE: /pos [x] [y] [z/'find'] ([a])");
if(!strcmp(z, "find", true))
{
if(IsPlayerInAnyVehicle(playerid))
{
new vehicleid = GetPlayerVehicleID(playerid);
new pseat = GetPlayerVehicleSeat(playerid);
new Float:newz;
for(new i; i < 3; i++)
SetPlayerPosFindZ(playerid, x, y, 20.0);
GetPlayerPos(playerid, x, y, newz);
SetVehiclePos(vehicleid, x, y, newz);
SetVehicleZAngle(vehicleid, a);
PutPlayerInVehicle(playerid, vehicleid, pseat);
SendClientMessage(playerid, 0xFFFFFFAA, "Teleportado com carro e findz.");
} else {
for(new i; i < 3; i++)
SetPlayerPosFindZ(playerid, x, y, 20.0);
SendClientMessage(playerid, 0xFFFFFFAA, "Teleportado a pй com findz.");
}
} else {
if(IsPlayerInAnyVehicle(playerid))
{
SetVehiclePos(GetPlayerVehicleID(playerid), x, y, floatstr(z));
SetVehicleZAngle(GetPlayerVehicleID(playerid), a);
SendClientMessage(playerid, 0xFFFFFFAA, "Teleportado com carro sem findz.");
} else {
SetPlayerPos(playerid, x, y, floatstr(z));
SetPlayerFacingAngle(playerid, a);
SendClientMessage(playerid, 0xFFFFFFAA, "Teleportado a pй sem findz.");
}
}
SetCameraBehindPlayer(playerid);
return 1;
}