[HELP]Command says I am also not connected!!! -
Cjgogo - 26.09.2011
pawn Код:
COMMAND:goto(playerid,params[])
{
if(GetPVarInt(playerid,"Adminlevel") < 1) return SendClientMessage(playerid,COLOR_RED,"This command is only for admin level 1");
if(GetPVarInt(playerid,"Adminlevel") >=1)
{
new ID;
if(sscanf(params,"u",ID)) return SendClientMessage(playerid,COLOR_RED,"USAGE:/goto [ID]");
else if(ID == playerid) return SendClientMessage(playerid,COLOR_RED,"You can't teleport to yourself");
else if(ID == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED,"The player is not connected");
{
new Float:x,Float:y,Float:z;
GetPlayerPos(ID,x,y,z);
SetPlayerPos(playerid,x,y+1,z);
}
}
return true;
}
Lol,please help,when I type in my ID(0) says that The Player is not connected instead of telling that "You can't tele to yourself" and I can't spot mistake.
Re: [HELP]Command says I am also not connected!!! -
iJumbo - 26.09.2011
if(IsPlayerConnected(ID)) you need no else ..
Re: [HELP]Command says I am also not connected!!! -
Cjgogo - 26.09.2011
pawn Код:
COMMAND:goto(playerid,params[])
{
if(GetPVarInt(playerid,"Adminlevel") < 1) return SendClientMessage(playerid,COLOR_RED,"This command is only for admin level 1");
if(GetPVarInt(playerid,"Adminlevel") >=1)
{
new ID;
if(sscanf(params,"u",ID)) return SendClientMessage(playerid,COLOR_RED,"USAGE:/goto [ID]");
if(ID == playerid) return SendClientMessage(playerid,COLOR_RED,"You can't teleport to yourself");
if(!IsPlayerConnected(ID)) return SendClientMessage(playerid,COLOR_RED,"The player is not connected");
{
new Float:x,Float:y,Float:z;
GetPlayerPos(ID,x,y,z);
SetPlayerPos(playerid,x,y+1,z);
}
}
return true;
}
You mean like that?Still same error -.-
Re: [HELP]Command says I am also not connected!!! -
vassilis - 26.09.2011
how i can make the code example i mean to show it on pawno here to the forum?
Re: [HELP]Command says I am also not connected!!! -
iJumbo - 26.09.2011
pawn Код:
OMMAND:goto(playerid,params[])
{
if(GetPVarInt(playerid,"Adminlevel") < 1) return SendClientMessage(playerid,COLOR_RED,"This command is only for admin level 1");
new ID;
if(sscanf(params,"u",ID)) return SendClientMessage(playerid,COLOR_RED,"USAGE:/goto [ID]");
if(ID == playerid) return SendClientMessage(playerid,COLOR_RED,"You can't teleport to yourself");
if(!IsPlayerConnected(ID)) return SendClientMessage(playerid,COLOR_RED,"The player is not connected");
new Float:x,Float:y,Float:z;
GetPlayerPos(ID,x,y,z);
SetPlayerPos(playerid,x,y+1,z);
return true;
}
vassilis [ PAWN ] [/ PAWN]
Re: [HELP]Command says I am also not connected!!! -
vassilis - 26.09.2011
ok thank you man
Re: [HELP]Command says I am also not connected!!! -
Cjgogo - 26.09.2011
you may say i am making fool of you jumbo,and I AM ALSO AMAZED,but the command still says when /goto 0 (me) that i am not connected(I AM NOT JOKING)
Re: [HELP]Command says I am also not connected!!! -
iJumbo - 26.09.2011
MMmh
still the same if you do
if(!IsPlayerConnected(ID) || ID== playerid) return message.. player not connected or its you
maybe you have some npc?
Re: [HELP]Command says I am also not connected!!! -
Cjgogo - 26.09.2011
weel,what a philosophy for a command now it's working LOL and when u said "is not connected or is yourself" I remembered something :before I decided to make my own admin system,I used Lethal Admin and the error message was the same u said,in conclusion maybe it's a bug so it can't send different error messages like "is yourself" is not connected" or I JUST DON'T KNOW WHY wasn't working.anyway I have no NPC(I can't make up my minds if I should use some or no :P)
Re: [HELP]Command says I am also not connected!!! -
Wesley221 - 26.09.2011
pawn Код:
COMMAND:goto(playerid,params[])
{
if(GetPVarInt(playerid,"Adminlevel") < 1) return SendClientMessage(playerid,COLOR_RED,"This command is only for admin level 1");
new ID;
if( !sscanf(params,"u",ID) )
{
if(ID == playerid) return SendClientMessage(playerid,COLOR_RED,"You can't teleport to yourself");
if(ID == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED,"The player is not connected");
new Float:x,Float:y,Float:z;
GetPlayerPos(ID,x,y,z);
SetPlayerPos(playerid,x,y+1,z);
} else return SendClientMessage(playerid,COLOR_RED,"USAGE:/goto [ID]");
return true;
}
Try this