Definitly i need tooglegoto [rep+1] ! ! ! - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Definitly i need tooglegoto [rep+1] ! ! ! (
/showthread.php?tid=334300)
Definitly i need tooglegoto [rep+1] ! ! ! -
ProdrifterX - 14.04.2012
Ello Guys :P
ehmm..
Listen up :P
Iam using Lux admin, and iam using luxadmin goto cmd too, so i need dcmd tooglegoto
what tooglegoto means? it means... example: when some one want to teleport to me and he's boring with that command, i can type /tooglegoto or /gotooff and no one can teleport to me.
I need it too much..
Thanks so much guys
REP+1!
Re: Definitly i need tooglegoto [rep+1] ! ! ! -
]Rafaellos[ - 14.04.2012
pawn Код:
"Top of your script:"
new gotost[MAX_PLAYERS];
"OnPlayerConnect:"
gotost[playerid] = 1;
"Replace the goto with this:"
dcmd_goto(playerid,params[])
{
if(AccInfo[playerid][Level] >= 0 || IsPlayerAdmin(playerid))
{
if(!strlen(params)) return
SendClientMessage(playerid, LIGHTBLUE2, "Usage: /goto [PlayerID]") &&
SendClientMessage(playerid, orange, "Function: Will Go to specified player");
new player1, string[128];
if(!IsNumeric(params)) player1 = ReturnPlayerID(params);
else player1 = strval(params);
if(gotost[player1] == 0) return SendClientMessage(playerid, red, "You can't teleport to this player, because he disable the teleports to him.");
if(!IsPlayerConnected(player1) || player1 == INVALID_PLAYER_ID || player1 == playerid) return SendClientMessage(playerid, red, "This player is not connected or is you.");
SendCommandToAdmins(playerid,"Goto");
new Float:x, Float:y, Float:z; GetPlayerPos(player1,x,y,z); SetPlayerInterior(playerid,GetPlayerInterior(player1));
SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(player1));
if(GetPlayerState(playerid) == 2) {
SetVehiclePos(GetPlayerVehicleID(playerid),x+3,y,z );
LinkVehicleToInterior(GetPlayerVehicleID(playerid) ,GetPlayerInterior(player1));
SetVehicleVirtualWorld(GetPlayerVehicleID(playerid ),GetPlayerVirtualWorld(player1));
}
else SetPlayerPos(playerid,x+2,y,z);
format(string,sizeof(string),"{FFFFFF}Teleported to {FF0000}\"%s\"", pName(player1));
return SendClientMessage(playerid,blue,string);
}
else return ErrorMessages(playerid, 4);
}
dcmd_toggoto(playerid,params[]) {
#pragma unused params
if(gotost[playerid] == 1) {
SendClientMessage(playerid, -1, "They can't teleport to you.");
gotost[playerid] = 0;
}
else {
SendClientMessage(playerid, -1, "They can teleport to you.");
gotost[playerid] = 1;
}
return 1;
}
"Add this under dcmd(goto, 4, cmdtext);:"
dcmd(toggoto, 7, cmdtext);
I use it in my LuxAdmin system.
Re: Definitly i need tooglegoto [rep+1] ! ! ! -
Joe Staff - 14.04.2012
Don't forget to reset your variable under OnPlayerConnect or OnPlayerDisconnect, else the variable will still be the same as when the last player connected set it to.
Re: Definitly i need tooglegoto [rep+1] ! ! ! -
]Rafaellos[ - 14.04.2012
You have right, i edit my post.