goto cmds
#1

Hey guys im stucked with this cmd when i try to use it say unkown command where is the error?

PHP код:
CMD:gotols(playeridparams[]) 

    if(
PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playeridCOLOR_REDNOTADMIN); 
    else 
    { 
        
PlayerInfo[playerid][pInt] = 0
        
SetPlayerInterior(playerid0); 
           
SetPlayerPos(playerid1258.7352,-2036.7100,59.4561); 
           
SendClientMessage(playeridCOLOR_WHITE"You have been teleported to Los Santos!"); 
    } 
    return 
1

CMD:gotosf(playeridparams[]) 

    if(
PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playeridCOLOR_REDNOTADMIN); 
    else 
    { 
        
PlayerInfo[playerid][pInt] = 0
        
SetPlayerInterior(playerid0); 
           
SetPlayerPos(playerid, -2018.0339,145.6004,27.9839); 
           
SendClientMessage(playeridCOLOR_WHITE"You have been teleported to San Fierro!"); 
    } 
    return 
1

CMD:gotolv(playeridparams[]) 

    if(
PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playeridCOLOR_REDNOTADMIN); 
    else 
    { 
        
PlayerInfo[playerid][pInt] = 0
        
SetPlayerInterior(playerid0); 
           
SetPlayerPos(playerid2034.0673,1007.7039,10.8203); 
           
SendClientMessage(playeridCOLOR_WHITE"You have been teleported to Las Venturas!"); 
    } 
    return 
1

thanks in advice
Reply
#2

You don't need else there.


This should work just fine.
PHP код:
CMD:gotols(playeridparams[]) 

    if(
PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playeridCOLOR_REDNOTADMIN); 
    
PlayerInfo[playerid][pInt] = 0
    
SetPlayerInterior(playerid0); 
    
SetPlayerPos(playerid1258.7352,-2036.7100,59.4561); 
    
SendClientMessage(playeridCOLOR_WHITE"You have been teleported to Los Santos!"); 
    return 
1

Reply
#3

Do you get that message every time or only if you use the command when you're not an admin? If it's the latter, then try returning 1 rather than SendClientMessage. Then you code would look like this:


PHP код:
CMD:gotosf(playeridparams[])  
{  
    if(
PlayerInfo[playerid][pAdmin] < 2
    {      
SendClientMessage(playeridCOLOR_REDNOTADMIN);  
            return 
1;
     }
    else  
    {  
        
PlayerInfo[playerid][pInt] = 0;  
        
SetPlayerInterior(playerid0);  
           
SetPlayerPos(playerid, -2018.0339,145.6004,27.9839);  
           
SendClientMessage(playeridCOLOR_WHITE"You have been teleported to San Fierro!");  
    }  
    return 
1;  

Reply
#4

still not woking, says the same msg unknown cmd
Reply
#5

Seems like a crash.Compile the code in -d3 and use crashdetect plugin.It might give some more information about crash.
Reply
#6

PHP код:
[PHP]CMD:gotols(playeridparams[]) 

    if(
PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playeridCOLOR_REDNOTADMIN); 
     
    { 
        
PlayerInfo[playerid][pInt] = 0
        
SetPlayerInterior(playerid0); 
           
SetPlayerPos(playerid1258.7352,-2036.7100,59.4561); 
           
SendClientMessage(playeridCOLOR_WHITE"You have been teleported to Los Santos!"); 
    } 
    return 
1

CMD:gotosf(playeridparams[]) 

    if(
PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playeridCOLOR_REDNOTADMIN); 
     
    { 
        
PlayerInfo[playerid][pInt] = 0
        
SetPlayerInterior(playerid0); 
           
SetPlayerPos(playerid, -2018.0339,145.6004,27.9839); 
           
SendClientMessage(playeridCOLOR_WHITE"You have been teleported to San Fierro!"); 
    } 
    return 
1

CMD:gotolv(playeridparams[]) 

    if(
PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playeridCOLOR_REDNOTADMIN); 
     
    { 
        
PlayerInfo[playerid][pInt] = 0
        
SetPlayerInterior(playerid0); 
           
SetPlayerPos(playerid2034.0673,1007.7039,10.8203); 
           
SendClientMessage(playeridCOLOR_WHITE"You have been teleported to Las Venturas!"); 
    } 
    return 
1

[/PHP]

Код:
----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3.7-R2, ©2005-2015 SA-MP Team

[22:40:06] filterscripts = ""  (string)
[22:40:06] weburl = "www.sa-mp.com"  (string)
[22:40:06] 
[22:40:06] Server Plugins
[22:40:06] --------------
[22:40:06]  Loading plugin: crashdetect
[22:40:06]   CrashDetect v4.15.1 is OK.
[22:40:06]   Loaded.
[22:40:06]  Loading plugin: sscanf
[22:40:06] 

[22:40:06]  ===============================

[22:40:06]       sscanf plugin loaded.     

[22:40:06]          Version:  2.8.2        

[22:40:06]    © 2012 Alex "******" Cole  

[22:40:06]  ===============================

[22:40:06]   Loaded.
[22:40:06]  Loading plugin: nativechecker
[22:40:06]   Loaded.
[22:40:06]  Loaded 3 plugins.

[22:40:06] 
[22:40:06] Filterscripts
[22:40:06] ---------------
[22:40:06]   Loaded 0 filterscripts.

[22:40:06]  
[22:40:06]  
[22:40:06]  
[22:40:06]  ======================================= 
[22:40:06]  |                                     | 
[22:40:06]  |        YSI version 3.09.0684        | 
[22:40:06]  |        By Alex "******" Cole        | 
[22:40:06]  |                                     | 
[22:40:06]  ======================================= 
[22:40:06]  
[22:40:06]  
[22:40:06]  
[22:40:06]  
[22:40:06] -------------------------------------------
[22:40:06] Connected to Grand Theft Auto Roleplay
[22:40:06] Welcome to Grand Theft Auto Roleplay
[22:40:06] -------------------------------------------
[22:40:06]  
[22:40:06] Number of vehicle models: 26
Reply
#7

Why'd you re-post this again?

Код:
CMD:gotols(playerid) 
{ 
    if(!IsPlayerAdmin(playerid)) {return 0;} 
    SetPlayerInterior(playerid, 0); 
    SetPlayerPos(playerid, 1258.7352,-2036.7100,59.4561); 
    SendClientMessage(playerid, COLOR_WHITE, "You have been teleported to Los Santos!");
    return 1; 
} 

CMD:gotosf(playerid) 
{ 
    if(!IsPlayerAdmin(playerid)) {return 0;}
    SetPlayerInterior(playerid, 0); 
    SetPlayerPos(playerid, -2018.0339,145.6004,27.9839); 
    SendClientMessage(playerid, COLOR_WHITE, "You have been teleported to San Fierro!"); 
    return 1; 
} 

CMD:gotolv(playerid) 
{ 
    if(!IsPlayerAdmin(playerid)) {return 0;}
    SetPlayerInterior(playerid, 0); 
    SetPlayerPos(playerid, 2034.0673,1007.7039,10.8203); 
    SendClientMessage(playerid, COLOR_WHITE, "You have been teleported to Las Venturas!"); 
    return 1;
}
Notice no else as was mentioned before.
Reply
#8

because still not working, anyone can help me?
Reply
#9

Quote:
Originally Posted by Jaua10
Посмотреть сообщение
because still not working, anyone can help me?
Maybe cause you are not RCON admin...
Reply
#10

You probably aren't logged into RCON.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)