08.01.2017, 20:37
And this (added interior + vw for more logic) ?
PHP код:
CMD:gotocoord(playerid,params[]) {
if(PlayerInfo[playerid][Level] >= 4)
{
new Float:x,
Float:y,
Float:z,
interior,
virtualworld;
if(sscanf(params, "fffI(0)I(0)", x, y, z, interior, virtualworld))
return SendClientMessage(playerid,red,"ERROR: Usage /gotocoord [X] [Y] [Z] [optional: interior] [optional: virtualworld]");
new PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid,PlayerName,sizeof(PlayerName));
if(PlayerInfo[playerid][Jailed] == 1)
return SendClientMessage(playerid,COLOR_BRIGHTRED,"You cannot escape your punishment!");
if(gettime() < tseconds[playerid])
{
format(tstring,45,"You Must wait %d seconds before teleporting", gettime()-tseconds[playerid]);
return SendClientMessage(playerid, red, tstring); // i think
}
tseconds[playerid] = gettime()+6;
vCount[playerid] = 1;
Tx[playerid] = x;
Ty[playerid] = y;
Tz[playerid] = z;
Ti[playerid] = 0;
format(telestring,43,"Coord!");
format(nstring, sizeof(nstring),"[TELE]:Admin %s has just Teleported To a coordinates (/gotocoord)", PlayerName);
SendClientMessageToAll(COLOR_LIGHTBLUE, nstring);
SetTimerEx("setstunt",3000,0,"i", playerid);
}
else return ShowPlayerDialog(playerid, 90321, DIALOG_STYLE_MSGBOX, "{FF0000}SFTDM - ERROR MSG", HighLevel,"OK","");
return 1;
}