Command Request ( /toggoto ) -
MrCripBloodz - 14.06.2012
Hello Everyone i was searching for /toggoto command but could not found i need this command for my server i hope that you all no wat it does if player type /toggoto other player cant tele him using /goto please if anyone know.
Thanx in Advance.
plz dont give in CMD:
i dont use it i use
if(strcmp(cmdtext, "/toggoto", true) == 0)
Re: Command Request ( /toggoto ) -
jessejanssen - 14.06.2012
To start with, this isn't the place to request scripts at.
Second, we aren't people from Star Wars who can warp to you, look in your script, and create a command for you. We cannot creat a /toggoto command without knowing the script or just the /goto command but even if we could I'll say again:
This isn't the place to requests scripts.
Best regards,
Jesse
Re: Command Request ( /toggoto ) -
Kindred - 14.06.2012
Simple thing I whipped up.
pawn Код:
new gototog[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
gototog[playerid] = 0;
return 1;
}
CMD:goto(playerid, params[])
{
new targetid, string[128];
if(sscanf(params, "u", targetid))
{
return SendClientMessage(playerid, COLOR_GRAY, "Usage: /goto [playerid]");
}
else if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, -1, "Invalid player specified.");
else if(targetid == playerid) return SendClientMessage(playerid, -1, "You cannot use this command on yourself!");
else if(gototog[targetid] == 1) return SendClientMessage(playerid, -1, "That player has disabled players from going to them");
new Float: pos[3];
GetPlayerPos(targetid, pos[0], pos[1], pos[2]);
SetPlayerInterior(playerid, GetPlayerInterior(targetid));
SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(targetid));
return 1;
}
CMD:toggoto(playerid, params[])
{
if(gototog[playerid] == 0)
{
gototog[playerid] = 1;
SendClientMessage(playerid, -1, "Other players may not teleport to you now!");
}
else if(gototog[playerid] == 1)
{
gototog[playerid] = 0;
SendClientMessage(playerid, -1, "Other players may teleport to you now!");
}
return 1;
}
/goto command I got from my own script. This simply creates a variable gototog, and sets it to 0 when the player joins (people can goto him). Then if they /toggoto, it sets it either disabled or disabled, depending on what it already is.
Untested, could work though. Tired, wasn't paying much attention while I scripted.
Re: Command Request ( /toggoto ) -
MrCripBloodz - 14.06.2012
Quote:
Originally Posted by Kindred
Simple thing I whipped up.
pawn Код:
new gototog[MAX_PLAYERS];
public OnPlayerConnect(playerid) { gototog[playerid] = 0; return 1; }
CMD:goto(playerid, params[]) { new targetid, string[128]; if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_GRAY, "Usage: /goto [playerid]"); } else if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, -1, "Invalid player specified."); else if(targetid == playerid) return SendClientMessage(playerid, -1, "You cannot use this command on yourself!"); else if(gototog[targetid] == 1) return SendClientMessage(playerid, -1, "That player has disabled players from going to them"); new Float: pos[3]; GetPlayerPos(targetid, pos[0], pos[1], pos[2]); SetPlayerInterior(playerid, GetPlayerInterior(targetid)); SetPlayerPos(playerid, pos[0], pos[1], pos[2]); SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(targetid)); return 1; }
CMD:toggoto(playerid, params[]) { if(gototog[playerid] == 0) { gototog[playerid] = 1; SendClientMessage(playerid, -1, "Other players may not teleport to you now!"); } else if(gototog[playerid] == 1) { gototog[playerid] = 0; SendClientMessage(playerid, -1, "Other players may teleport to you now!"); } return 1; }
/goto command I got from my own script. This simply creates a variable gototog, and sets it to 0 when the player joins (people can goto him). Then if they /toggoto, it sets it either disabled or disabled, depending on what it already is.
Untested, could work though. Tired, wasn't paying much attention while I scripted.
|
Thankx!
But it make bug for my server when i type any wrong command doesnt show anything like uknown command it doesnt show it and got warning
warning 225: unreachable code and i just need is /toggoto and /goto command i already got :S
Re: Command Request ( /toggoto ) -
denNorske - 14.06.2012
Cripz, let me help you out with this one
Re: Command Request ( /toggoto ) -
Faisal_khan - 14.06.2012
This in strcmp:
pawn Код:
if(strcmp(cmdtext, "/goto", true) == 0)
{
new targetid;
if(sscanf(cmdtext[6], "u", targetid))//since in strcmp we cannot use params so i added this cmdtext[6]
{
return SendClientMessage(playerid, COLOR_GRAY, "Usage: /goto [playerid]");
}
else if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, -1, "Invalid player specified.");
else if(targetid == playerid) return SendClientMessage(playerid, -1, "You cannot use this command on yourself!");
else if(gototog[targetid] == 1) return SendClientMessage(playerid, -1, "That player has disabled players from going to them");
new Float: pos[3];
GetPlayerPos(targetid, pos[0], pos[1], pos[2]);
SetPlayerInterior(playerid, GetPlayerInterior(targetid));
SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(targetid));
return 1;
}
if(strcmp(cmdtext, "/toggoto", true) == 0)
{
if(gototog[playerid] == 0)
{
gototog[playerid] = 1;
SendClientMessage(playerid, -1, "Other players may not teleport to you now!");
}
else if(gototog[playerid] == 1)
{
gototog[playerid] = 0;
SendClientMessage(playerid, -1, "Other players may teleport to you now!");
}
return 1;
}
You guyz don't read it? Crip said he wants the cmd in strcmp.
Copied and modified.
Source:
Kindred
Re: Command Request ( /toggoto ) -
MrCripBloodz - 14.06.2012
Quote:
Originally Posted by Faisal_khan
This in strcmp:
pawn Код:
if(strcmp(cmdtext, "/goto", true) == 0) { new targetid; if(sscanf(cmdtext[6], "u", targetid))//since in strcmp we cannot use params so i added this cmdtext[6] { return SendClientMessage(playerid, COLOR_GRAY, "Usage: /goto [playerid]"); } else if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, -1, "Invalid player specified."); else if(targetid == playerid) return SendClientMessage(playerid, -1, "You cannot use this command on yourself!"); else if(gototog[targetid] == 1) return SendClientMessage(playerid, -1, "That player has disabled players from going to them"); new Float: pos[3]; GetPlayerPos(targetid, pos[0], pos[1], pos[2]); SetPlayerInterior(playerid, GetPlayerInterior(targetid)); SetPlayerPos(playerid, pos[0], pos[1], pos[2]); SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(targetid)); return 1; }
if(strcmp(cmdtext, "/toggoto", true) == 0) { if(gototog[playerid] == 0) { gototog[playerid] = 1; SendClientMessage(playerid, -1, "Other players may not teleport to you now!"); } else if(gototog[playerid] == 1) { gototog[playerid] = 0; SendClientMessage(playerid, -1, "Other players may teleport to you now!"); } return 1; }
You guyz don't read it? Crip said he wants the cmd in strcmp.
Copied and modified.
Source: Kindred
|
Thankx.
Re: Command Request ( /toggoto ) -
MrCripBloodz - 14.06.2012
Quote:
Originally Posted by airplanesimen
Cripz, let me help you out with this one 
|
Thankx brah (;
Re: Command Request ( /toggoto ) -
Faisal_khan - 14.06.2012
No problem but dude don't double post the last post can also be included in the second last using multi-qoute.
Anyway no problem.