Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- if(playerVariables[playerid][pAdminLevel] >= 1 || playerVariables[playerid][pHelper] >= 1)
- {
- new message[256],name[MAX_PLAYER_NAME];
- GetPlayerName(clickedplayerid, name, MAX_PLAYER_NAME);
- format(message, sizeof(message), "You clicked on player %s (%d).",name,clickedplayerid);
- SendClientMessage(playerid, COLOR_TEAL, message);
- showId(playerid, clickedplayerid);
- new userID = clickedplayerid;
- if(playerVariables[playerid][pWarrants] == 0)
- {
- if(playerVariables[playerid][pPrisonTime] <= 1)
- {
- if(groupVariables[playerVariables[playerid][pGroup]][gInWar] == 0)
- {
- GetPlayerPos(playerid, TeleportDest[playerid][0],TeleportDest[playerid][1],TeleportDest[playerid][2]);
- Interior[playerid] = GetPlayerInterior(playerid);
- VirWorld[playerid] = GetPlayerVirtualWorld(playerid);
- TogglePlayerSpectating(playerid, 1);
- playerVariables[playerid][pSpectating] = userID;
- if(IsPlayerInAnyVehicle(userID))
- {
- new string[500];
- new Float: health;
- GetPlayerHealth(userID, health);
- new Float:health2;
- new veh = GetPlayerVehicleID(userID);
- GetVehicleHealth(veh, health2);
- new Speed = GetSpeed(userID);
- format(string, 500,"%s [%i] - L %i", playerVariables[userID][pNormalName], userID,playerVariables[userID][pLevel]);
- TextDrawSetString(info[playerid], string);
- format(string, 500,"Health: %.0f", health);
- TextDrawSetString(viata[playerid], string);
- format(string, 500,"W: %d - Jail: %d minutes", playerVariables[userID][pWarrants], playerVariables[userID][pPrisonTime] / 60);
- TextDrawSetString(wantedjail[playerid], string);
- format(string, 500,"Car %d [%.0f HP]", GetPlayerVehicleID(userID), health2);
- TextDrawSetString(carinfo[playerid], string);
- format(string, 500,"Speed: %d KM/H", Speed);
- TextDrawSetString(carspeed[playerid], string);
- TextDrawShowForPlayer(playerid, info[playerid]);
- TextDrawShowForPlayer(playerid, carspeed[playerid]);
- TextDrawShowForPlayer(playerid, carinfo[playerid]);
- TextDrawShowForPlayer(playerid, viata[playerid]);
- TextDrawShowForPlayer(playerid, wantedjail[playerid]);
- PlayerSpectateVehicle(playerid, GetPlayerVehicleID(userID));
- }
- else
- {
- new Speed = GetSpeed(userID);
- new string[500];
- new Float: health;
- GetPlayerHealth(userID, health);
- new Float:health2;
- new veh = GetPlayerVehicleID(userID);
- GetVehicleHealth(veh, health2);
- format(string, 500,"%s [%i] - L %i", playerVariables[userID][pNormalName], userID,playerVariables[userID][pLevel]);
- TextDrawSetString(info[playerid], string);
- format(string, 500,"Health: %.0f", health);
- TextDrawSetString(viata[playerid], string);
- format(string, 500,"W: %d - Jail: %d minutes", playerVariables[userID][pWarrants], playerVariables[userID][pPrisonTime] / 60);
- TextDrawSetString(wantedjail[playerid], string);
- format(string, 500,"Car %d [%.0f HP]", GetPlayerVehicleID(userID), health2);
- TextDrawSetString(carinfo[playerid], string);
- format(string, 500,"Speed: %d KM/H", Speed);
- TextDrawSetString(carspeed[playerid], string);
- TextDrawShowForPlayer(playerid, info[playerid]);
- TextDrawShowForPlayer(playerid, viata[playerid]);
- TextDrawShowForPlayer(playerid, wantedjail[playerid]);
- PlayerSpectatePlayer(playerid, userID);
- }
- new Float:HAFloats, country[MAX_COUNTRY_NAME];
- GetPlayerHealth(userID,HAFloats);
- GetCountryName(playerVariables[userID][pConnectionIP], country, sizeof(country));
- format(szMessage, sizeof(szMessage), "(%i) %s | Level: %i | Health: %.1f | Status: %d | Country: %s | Ping: %i",userID, GetName(userID),playerVariables[userID][pLevel], HAFloats,playerVariables[userID][pStatus],country, GetPlayerPing(userID));
- SCM(playerid,COLOR_IN2, szMessage);
- }
- else SendClientMessage(playerid, COLOR_GREY, "You can't use this command in war time.");
- }
- else SendClientMessage(playerid, COLOR_GREY, "You can't spectate because you are in jail.");
- }
- else SendClientMessage(playerid, COLOR_GREY, "You are wanted, you can't spectante anyone.");
- }
- return 1;
- }
Add Comment
Please, Sign In to add comment