new bool:goto[MAX_PLAYERS];
dcmd_goto(playerid,params[]) {
if(!strlen(params)) {
return SendClientMessage(playerid,COLOR_RED,"USAGE: /goto [playerid]");
}
new
pID=strval(params);
if(!IsPlayerConnected(pID)) {
return SendClientMessage(playerid,COLOR_RED,"Kein Spieler mit angegebener ID Online");
}
if(goto[pID] == false)return SendClientMessage(playerid, COLOR_RED, "Info: Du kannst dich nicht zu diesem Spieler teleportieren");
new Float:x, Float:y, Float:z;
GetPlayerPos(pID, x, y, z);
SetPlayerPos(playerid, x, y, z);
SendClientMessage(playerid, COLOR_YELLOW, "Erfolgreich teleportiert");
new name[MAX_PLAYER_NAME], string[44];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s hat sich zu dir teleportiert.",name);
SendClientMessage(pID,COLOR_YELLOW, string);
return 1;
}
dcmd_gotooff(playerid, params[])
{
#pragma unused params
if(goto[playerid] == false)
{
goto[playerid] = true;
SendClientMessage(playerid, COLOR_GREEN, "Info: Es kann sich nun niemand mehr zu dir Teleportieren");
return true;
}
}
dcmd_gotoon(playerid, params[])
{
#pragma unused params
if(goto[playerid] == true)
{
goto[playerid] = false;
SendClientMessage(playerid, COLOR_GREEN, "Info: Es kann sich nun wieder zu dir hin teleportiert werden");
return true;
}
}