pls a little help with OnPlayerClickPlayer
#1

well i really need little help with this teleport.

so i want to alow player teleport to another player when he is not in dm area, but if he is in another dm area so that other players cant teleport to him.
so if in dm:
if(strcmp(cmdtext, "/dm", true) == 0)
{
DMZone[playerid] = 1; //so this is for when player is in dm,
GivePlayerWeapon(playerid, 18, 100);//molotow
SetPlayerRandomSpawnDM(playerid);
SetPlayerFacingAngle(playerid,249.2069);
SetPlayerInterior(playerid,0);
DynUpdateStart(playerid);
CMDMessageToAll(playerid,"MW2");
return 1;
}
if(strcmp(cmdtext, "/ldm", true) == 0)//leave dm
{
DMZone[playerid] = 0; //so this is for when player is out from dm,
SetPlayerRandomSpawnOUTDM(playerid);
return 1;
}
THIs is my click teleport or something working good for me
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
if(PlayerInfo[playerid][Boss] >= 1 || PlayerInfo[playerid][vip] >= 1) {
GetPlayerName(clickedplayerid, pname, MAX_PLAYER_NAME);
GetPlayerPos(clickedplayerid, x, y, z);
SetPlayerVirtualWorld(playerid,GetPlayerVirtualWor ld(player1));
if(GetPlayerState(playerid) == 2) {
SetPlayerVirtualWorld(playerid,GetPlayerVirtualWor ld(playerid));
SetVehiclePos(GetPlayerVehicleID(playerid),x+3,y,z +1);
LinkVehicleToInterior(GetPlayerVehicleID(playerid) ,GetPlayerInterior(player1));
SetVehicleVirtualWorld(GetPlayerVehicleID(playerid ),GetPlayerVirtualWorld(player1));
} else SetPlayerPos(playerid,x,y,z+1);
format(string, sizeof(string), "You have teleported to %s", pname);
SendClientMessage(playerid, blue, string);
} else return SendClientMessage(playerid,red,"ERROR: You need to be admin/VIP to use Click teleporting");
return 0;
}
__________________________________________________ ___________________________________________
I need to add in this DMZone[playerid] = 1; to not alove for players to teleport to another player when they are in dm, and player who is in dm not to alow him to teleport to another player. And DMZone[playerid] = 0; to alow players to teleport when they are not in dm zones

I can simple create CLICKtele[playerid]=0 and CLICKtele[playerid]=1 for allowing teleport, but that take more resource, and i want to have it clean, since i have DMZone[playerid] = 1 and DMZone[playerid] = 0

If u know this add it will helped me very much and sory for my bad english and explanation
Reply
#2

Thx for big help, but i solved this by myself and now its working as i wanted
Reply
#3

Quote:
Originally Posted by Elmin
Посмотреть сообщение
Thx for big help, but i solved this by myself and now its working as i wanted
Your welcome
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)