Unkown command
#1

hello guys i have a problem in my teleport to coordinates cmd which is when i use /gotocoord only it shows the usage and after i use /gotocoord cx xy cz i only gets Unknown Command

pawn Код:
CMD:gotocoord(playerid,params[]) {
    if(PlayerInfo[playerid][Level] >= 4)
    {
        new Float:x,Float:y,Float:z;
        if(sscanf(params,"iii",x,y,z))return SendClientMessage(playerid,red,"ERROR: Usage /gotocoord [X] [Y] [Z]");
        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!");
        TeleTimer[playerid] = SetTimerEx("ttimer", 1000, true, "i",playerid);
        tseconds[playerid] = 6;
        format(tstring,45,"You Must wait %d seconds before teleporting", tseconds[playerid]-1);
        if(PlayerInfo[playerid][Level] == 0) SendClientMessage(playerid,COLOR_LIGHTBLUE, tstring);
        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;
}
also the problem is not from the telestrings cause i have another commands like this and they work like a charm!
Reply
#2

PHP код:
CMD:gotocoord(playerid,params[]) {
    if(
PlayerInfo[playerid][Level] >= 4)
    {
        new 
Float:x,Float:y,Float:z;
        if(
sscanf(params,"fff",x,y,z))return SendClientMessage(playerid,red,"ERROR: Usage /gotocoord [X] [Y] [Z]");
        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!");
        
TeleTimer[playerid] = SetTimerEx("ttimer"1000true"i",playerid);
        
tseconds[playerid] = 6;
        
format(tstring,45,"You Must wait %d seconds before teleporting"tseconds[playerid]-1);
        if(
PlayerInfo[playerid][Level] == 0SendClientMessage(playerid,COLOR_LIGHTBLUEtstring);
        
vCount[playerid] = 1;
        
Tx[playerid] = x;
        
Ty[playerid] = y;
        
Tz[playerid] = z;
        
Ti[playerid] = 0;
        
format(telestring,43,"Coord!");
        
format(nstringsizeof(nstring),"[TELE]:Admin %s has just Teleported To a coordinates (/gotocoord)"PlayerName);
        
SendClientMessageToAll(COLOR_LIGHTBLUEnstring);
        
SetTimerEx("setstunt",3000,0,"i"playerid);
    }
    else return 
ShowPlayerDialog(playerid90321DIALOG_STYLE_MSGBOX"{FF0000}SFTDM - ERROR MSG"HighLevel,"OK","");
    return 
1;

Reply
#3

still the same bro.. bumb!
Reply
#4

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)"xyzinteriorvirtualworld))
            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(playeridredtstring); // 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(nstringsizeof(nstring),"[TELE]:Admin %s has just Teleported To a coordinates (/gotocoord)"PlayerName);
        
SendClientMessageToAll(COLOR_LIGHTBLUEnstring);
        
SetTimerEx("setstunt",3000,0,"i"playerid);
    }
    else return 
ShowPlayerDialog(playerid90321DIALOG_STYLE_MSGBOX"{FF0000}SFTDM - ERROR MSG"HighLevel,"OK","");
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)