Help about duel and godmode -
vikassharma - 15.02.2014
Hello guys,
I'm using this gamemode
https://sampforum.blast.hk/showthread.php?tid=313612
And there is duel system only for admins via lux admin, but i want duel for everyone else by simple command /duel
also there is godmode for admins only via lux admin, but i want all player can enable/disable godmode and if godmode enabled they cannot use weapons ?
Please help me guys !
Re: Help about duel and godmode -
Clad - 15.02.2014
Remove If(PlayerInfo[playerid][pAdmin] or something like so all players can use the command
And about /godmode I guess you have to do ResetWeapons
Re: Help about duel and godmode -
vikassharma - 15.02.2014
Bro sorry but m new can u please tell in details,
Anyways if i remove admin access from /duel command then player will exploit my server cause in luxadmin /duel there is option like :-
/duel playerid1 playerid2 area
In other words they will get admin access for this command only, so i want only simple /duel for player by which they can invite other player and other player must accept to start duel
Re: Help about duel and godmode -
vikassharma - 15.02.2014
Quote:
Originally Posted by Clad
And about /godmode I guess you have to do ResetWeapons
|
It will work but they can use weapons also, so i want if player use /godmode they cannot use weapons if they again type /godmode they get their weapons back
Re: Help about duel and godmode -
vikassharma - 16.02.2014
Please someone help.. :\
Re: Help about duel and godmode -
rakshith122 - 16.02.2014
Maybe try this for duel and god
pawn Код:
dcmd_duel(playerid,params[])
{
new Index;
new tmp[256]; tmp = strtok(params,Index);
new tmp2[256]; tmp2 = strtok(params,Index);
new tmp3[256]; tmp3 = strtok(params,Index);
if(!strlen(tmp) || !strlen(tmp2) || !IsNumeric(tmp) || !IsNumeric(tmp2))
{
SendClientMessage(playerid, LIGHTBLUE2, "Usage: /duel [PlayerID 1] [PlayerID 2] [Location (1,2,3)]");
return SendClientMessage(playerid, orange, "Function: Will start a duel per two Players in specified Location!");
}
new player1 = strval(tmp);
new player2 = strval(tmp2);
new location, string[128];
if(!strlen(tmp3))
location = 0;
else location = strval(tmp3);
if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID)
{
if(IsPlayerConnected(player2) && player2 != INVALID_PLAYER_ID)
{
if(InDuel[player1] == 1) return SendClientMessage(playerid,red,"ERROR: Player One is already in a Duel!");
if(InDuel[player2] == 1) return SendClientMessage(playerid,red,"ERROR: Player Two is already in a Duel!");
if(location == 1) {
SetPlayerInterior(player1,16);
SetPlayerPos(player1,-1404.067,1270.3706,1042.8672);
SetPlayerInterior(player2,16);
SetPlayerPos(player2,-1395.067,1261.3706,1042.8672);
}
else if(location == 2) {
SetPlayerInterior(player1,0);
SetPlayerPos(player1,1353.407,2188.155,11.02344);
SetPlayerInterior(player2,0);
SetPlayerPos(player2,1346.255,2142.843,11.01563);
}
else if(location == 3) {
SetPlayerInterior(player1,10);
SetPlayerPos(player1,-1041.037,1078.729,1347.678);
SetPlayerFacingAngle(player1,135);
SetPlayerInterior(player2,10);
SetPlayerPos(player2,-1018.061,1052.502,1346.327);
SetPlayerFacingAngle(player2,45);
}
InDuel[player1] = 1;
InDuel[player2] = 1;
SendCommandToAdmins(playerid,"Duel");
cdt[player1] = 6;
SetTimerEx("Duel",1000,0,"dd", player1, player2);
format(string, sizeof(string), "|- Administrator \"%s\" has started a duel Between \"%s\" and \"%s\" -|",pName(playerid),pName(player1),pName(player2));
SendClientMessage(player1, blue, string); SendClientMessage(player2, blue, string);
return SendClientMessage(playerid, blue, string);
}
else return SendClientMessage(playerid, red, "ERROR: Player Two is not connected");
}
else return SendClientMessage(playerid, red, "ERROR: Player One is not connected");
}
pawn Код:
dcmd_god(playerid,params[])
{
#pragma unused params
if(AccInfo[playerid][God] == 0)
{
AccInfo[playerid][God] = 1;
SetPlayerHealth(playerid,100000);
ResetPlayerWeapons(playerid); // Resets the player's weapon (Disarm)
SendClientMessage(playerid,green,"|- GodMod ON -|");
return SendCommandToAdmins(playerid,"God");
}
else
{
AccInfo[playerid][God] = 0;
SendClientMessage(playerid,red,"|- GodMod OFF -|");
SetPlayerHealth(playerid, 100);
}
return GivePlayerWeapon(playerid,29,500); (Gives M4 or something while god mode is turned off)
}
This allows normal players to use the command /duel and /god, While using /god, It will disarm the player.
Re: Help about duel and godmode -
vikassharma - 16.02.2014
Is this ok for godmode for normal players too :-
Код:
dcmd_god(playerid,params[])
{
#pragma unused params
if(AccInfo[playerid][Level] >= 0
{
AccInfo[playerid][God] = 1;
SetPlayerHealth(playerid,100000);
ResetPlayerWeapons(playerid); // Resets the player's weapon (Disarm)
SendClientMessage(playerid,green,"|- GodMod ON -|");
SendClientMessage(playerid,red,"You cannot use weapons in godmode");
return SendCommandToAdmins(playerid,"God");
}
else
{
AccInfo[playerid][God] = 0;
SendClientMessage(playerid,red,"|- GodMod OFF -|");
SendClientMessage(playerid,red,"Now you can safely use your weapons");
SetPlayerHealth(playerid, 100);
}
return GivePlayerWeapon(playerid,29,500); (Gives M4 or something while god mode is turned off)
}
And bro i want normal /duel [playerid] and other player must accept duel to start..
But you are saying to set level of luxadmin duel to 0 it will work but they will do /duel playerid1 playerid2 area
I only want simple /duel in which other player must accept duel to start