Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <zcmd>
- #include <sscanf2>
- new TPOnOff[MAX_PLAYERS];
- public OnFilterScriptInit()
- {
- print(" -- Sistema de Teleporte By: Panico -- ");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- TPOnOff[playerid] = 0;
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- TPOnOff[playerid] = 0;
- return 1;
- }
- CMD:tpon(playerid, params[])
- {
- TPOnOff[playerid] = 1;
- SendClientMessage(playerid, 0x999999FF, "Vc {FF0000}Ativou{999999} o Teleporte!Agora Qualquer Player Pode Se Teleportar ate vc");
- SendClientMessage(playerid, 0x999999FF, "Para desativar use: {FF0000}/tpoff");
- return 1;
- }
- CMD:tpoff(playerid, params[])
- {
- TPOnOff[playerid] = 0;
- SendClientMessage(playerid, 0x999999FF, "Vc {FF0000}Desativou {999999}o Teleporte!Agora os Player nao Podem mais Se Teleportar ate vc");
- SendClientMessage(playerid, 0x999999FF, "Para Ativar use: {FF0000}/tpon");
- return 1;
- }
- CMD:tp(playerid, params[])
- {
- new ID;
- new String[250];
- if(sscanf(params, "u", ID)) return SendClientMessage(playerid, 0x999999FF, "Use /tp [{FF0000}ID{999999}]");
- if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, 0x999999FF, "ID invalido");
- if(TPOnOff[ID] == 1)
- {
- new Float:x, Float:y, Float:z;
- GetPlayerPos(ID, x, y, z);
- SetPlayerPos(playerid, x, y, z);
- format(String, sizeof(String), "O Player {FF0000}%s {999999}veio até você!", nome(playerid));
- SendClientMessage(ID, 0x999999FF, String);
- format(String, sizeof(String), "Vc foi ate o Player {FF0000}%s", nome(ID));
- SendClientMessage(playerid, 0x999999FF, String);
- }
- else return SendClientMessage(ID, 0x999999FF, "O Player esta com o Teleporte {FF0000}Desativado");
- return 1;
- }
- stock nome(playerid)
- {
- new pnome[MAX_PLAYER_NAME];
- GetPlayerName(playerid, pnome, 24);
- return pnome;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement