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.