Skip to content

Commit

Permalink
Merge pull request #243 from Mrucznik/hotfixy
Browse files Browse the repository at this point in the history
Hotfixy
  • Loading branch information
Mrucznik authored Mar 22, 2020
2 parents 8495a23 + 37eb4b6 commit 5b58150
Show file tree
Hide file tree
Showing 34 changed files with 441 additions and 218 deletions.
5 changes: 5 additions & 0 deletions gamemodes/Mrucznik-RP.pwn
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ Mrucznik
#include <timestamptodate>
#include <discord-connector>
#include <memory>
#include <profiler_plugin>
//TODO: add plugins
// actors https://github.com/Dayrion/actor_plus
// #include <PawnPlus>
Expand Down Expand Up @@ -1747,6 +1748,7 @@ public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid, bodypart)
IsPlayerConnected(damagedid) ? GetPlayerLogName(damagedid) : sprintf("%d", damagedid),
amount,
weaponid);
return 1;
}

public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
Expand Down Expand Up @@ -5230,6 +5232,9 @@ public OnPlayerStateChange(playerid, newstate, oldstate)
{
sendTipMessageEx(playerid, COLOR_LIGHTBLUE, "Mo¿esz ukraœæ ten wóz, wpisz /kradnij aby spróbowaæ to zrobiæ.");
KradniecieWozu[playerid] = 1;
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(newcar, engine, lights, alarm, doors, bonnet, boot, objective);
if(engine) SetVehicleParamsEx(newcar, 0, lights, alarm, doors, bonnet, boot, objective);
}
}
gLastCar[playerid] = newcar;
Expand Down
4 changes: 2 additions & 2 deletions gamemodes/commands/cmd/ah.pwn
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ YCMD:ah(playerid, params[], help)
SendClientMessage(playerid, COLOR_GRAD1, "* SKRYPTER *** /mark /gotomark /gotocar /getcar /getposp");
SendClientMessage(playerid, COLOR_GRAD1, "* SKRYPTER *** /gotols /gotoszpital /gotolv /gotosf /gotoin /gotostad /gotojet");
SendClientMessage(playerid, COLOR_GRAD1, "* SKRYPTER *** /gotomechy /gotobank /gotostacja");
SendClientMessage(playerid, COLOR_GRAD1, "* SKRYPTER *** /zdejmijbpk /dajdowozu /specshow");
SendClientMessage(playerid, COLOR_GRAD1, "* SKRYPTER *** /zdejmijbpk /dajdowozu /specshow /setdrunk");
}
if (PlayerInfo[playerid][pAdmin] >= 1)
{
Expand Down Expand Up @@ -99,7 +99,7 @@ YCMD:ah(playerid, params[], help)
}
if (PlayerInfo[playerid][pAdmin] >= 35)
{
SendClientMessage(playerid, COLOR_GRAD4,"*35* ADMIN *** /undemorgan /fuelcars /setchamp /logout");
SendClientMessage(playerid, COLOR_GRAD4,"*35* ADMIN *** /undemorgan /fuelcars /setchamp /logout /setdrunk");
}
if (PlayerInfo[playerid][pAdmin] >= 100)
{
Expand Down
2 changes: 1 addition & 1 deletion gamemodes/commands/cmd/bw.pwn
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

YCMD:bw(playerid, params[], help)
{
if(PlayerInfo[playerid][pAdmin] >= 100)
if(PlayerInfo[playerid][pAdmin] >= 100 || IsAScripter(playerid))
{
new giveplayerid, czas, string[144];
if(sscanf(params, "k<fix>d", giveplayerid, czas))
Expand Down
2 changes: 1 addition & 1 deletion gamemodes/commands/cmd/maska.pwn
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ YCMD:maska(playerid, params[], help)
format(pName, sizeof(pName), "Zamaskowany_%d", maskid);
if(SetPlayerName(playerid, pName))
{
Log(maskLog, INFO, "Gracz %s za³o¿y³ maskê %s", GetPlayerLogName(playerid), pName);
SetPlayerColor(playerid, TEAM_HIT_COLOR);
SetRPName(playerid);
format(PlayerInfo[playerid][pNick], 24, "%s", pName);
SetPVarString(playerid, "maska_nick", sendername);
Log(nickLog, INFO, "Gracz %s za³o¿y³ maskê %s", GetPlayerLogName(playerid), pName);
}

}
Expand Down
71 changes: 71 additions & 0 deletions gamemodes/commands/cmd/setdrunk.pwn
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
//-----------------------------------------------<< Komenda >>-----------------------------------------------//
//------------------------------------------------[ nodrunk ]------------------------------------------------//
//----------------------------------------------------*------------------------------------------------------//
//----[ ]----//
//----[ ||||| ||||| |||||||||| |||||||||| ]----//
//----[ ||| ||| ||| ||| ||| |||| ||| |||| ]----//
//----[ ||| ||| ||| ||| ||| ||| ||| ||| ]----//
//----[ || || || || ||| ||| ||| ||| ]----//
//----[ ||| ||| ||| ||| ||| |||| ||| |||| ]----//
//----[ || || || || __________ |||||||||| |||||||||| ]----//
//----[ ||| ||| ||| ||| ||| ||| ||| ]----//
//----[ || || || || ||| || ||| ]----//
//----[ ||| ||| ||| ||| ||| ||| ||| ]----//
//----[ || || || || ||| || ||| ]----//
//----[ ||| ||| ||| ||| ||| ||| ||| ]----//
//----[ ||| ||||| ||| ||| ||| ||| ]----//
//----[ ]----//
//----------------------------------------------------*------------------------------------------------------//

// Opis:
/*
*/


// Notatki skryptera:
/*
*/

YCMD:setdrunk(playerid, params[], help)
{
if(IsPlayerConnected(playerid))
{
new string[144];
if (PlayerInfo[playerid][pAdmin] >= 35 || IsAScripter(playerid) )
{
new giveplayerid, level;
if(sscanf(params, "dd", giveplayerid, level))
{
sendTipMessage(playerid, "U¿yj /setdrunk [ID] [poziom (2000 wy³¹cza | max 50000)]");
return 1;
}

if(IsPlayerConnected(giveplayerid))
{
if(level < 2000) level = 2000;
else if(level > 50000) return sendTipMessage(playerid, "U¿yj /setdrunk [ID] [poziom (2000 wy³¹cza | max 50000)]");

SetPlayerDrunkLevel(giveplayerid, level);
format(string, sizeof(string), "AdmCmd: %s [%d] ustawi³ %s [%d] efekt pijactwa na [%d]",
GetNickEx(playerid),
playerid,
GetNick(giveplayerid),
giveplayerid,
(level == 2000 ? '0' : level)
);
SendMessageToAdmin(string, COLOR_RED);
}
else
{
return sendErrorMessage(playerid, "Nie ma takiego gracza");
}
}
else
{
noAccessMessage(playerid);
}
}
return 1;
}
4 changes: 2 additions & 2 deletions gamemodes/commands/cmd/setname.pwn
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ YCMD:setname(playerid, params[], help)
if(PlayerInfo[giveplayerid][pBusinessOwner] == INVALID_BIZ_ID)
{
GetPlayerName(giveplayerid, giveplayer, MAX_PLAYER_NAME);
new sender_log_name[MAX_PLAYER_NAME];
new giveplayer_log_name[MAX_PLAYER_NAME];
new sender_log_name[50];
new giveplayer_log_name[50];
format(sender_log_name, sizeof(sender_log_name), "%s", GetPlayerLogName(playerid));
format(giveplayer_log_name, sizeof(giveplayer_log_name), "%s", GetPlayerLogName(giveplayerid));
if(ChangePlayerName(giveplayerid, newname))
Expand Down
1 change: 1 addition & 0 deletions gamemodes/commands/cmd/setvw.pwn
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ YCMD:setvw(playerid, params[], help)

if (PlayerInfo[playerid][pAdmin] >= 1 || IsAScripter(playerid) || PlayerInfo[playerid][pNewAP] >= 1)
{
if(GetPlayerVirtualWorld(gracz) == intid) return SendClientMessage(playerid, COLOR_GRAD1, sprintf("%s ma ju¿ ustawiony %d virtualworld.", GetNick(gracz), intid));
SetPlayerVirtualWorld(gracz, intid);
format(string, sizeof(string), "Ustawi³eœ %s virtualworld nr %d.", GetNick(gracz), intid);
SendClientMessage(playerid, COLOR_GRAD1, string);
Expand Down
1 change: 1 addition & 0 deletions gamemodes/commands/commands.pwn
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@
#include "cmd/newbie.pwn"
#include "cmd/newcar.pwn"
#include "cmd/noa.pwn"
#include "cmd/setdrunk.pwn"
#include "cmd/nonewbie.pwn"
#include "cmd/noooc.pwn"
#include "cmd/nos.pwn"
Expand Down
10 changes: 6 additions & 4 deletions gamemodes/modules/admin/commands/admin_commands.pwn
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,22 @@
#include <YSI\y_hooks>

//-------<[ include ]>-------
#include "specshow\specshow.pwn"
#include "dmvoff\dmvoff.pwn"
#include "dmvon\dmvon.pwn"
#include "profiler\profiler.pwn"
#include "setvregistration\setvregistration.pwn"
#include "specshow\specshow.pwn"
#include "zmienwiek\zmienwiek.pwn"
#include "dmvoff\dmvoff.pwn"


//-------<[ initialize ]>-------
hook OnGameModeInit()
{
command_specshow();
command_dmvoff();
command_dmvon();
command_profiler();
command_setvregistration();
command_specshow();
command_zmienwiek();
command_dmvoff();

}
18 changes: 18 additions & 0 deletions gamemodes/modules/admin/commands/profiler/command.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "profiler",
"description": "Zarz¹dzanie profilerem.",
"permissions": [
"everyone"
],
"author": "Mrucznik",
"aliases": [],
"parameters": [
{
"type": "string",
"size": "32",
"name": "option",
"description": "start|stop|dump|status"
}
],
"date": "15.03.2020"
}
67 changes: 67 additions & 0 deletions gamemodes/modules/admin/commands/profiler/profiler.pwn
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
//------------------------------------------<< Generated source >>-------------------------------------------//
// profiler //
//----------------------------------------------------*------------------------------------------------------//
//----[ ]----//
//----[ ||||| ||||| |||||||||| |||||||||| ]----//
//----[ ||| ||| ||| ||| ||| |||| ||| |||| ]----//
//----[ ||| ||| ||| ||| ||| ||| ||| ||| ]----//
//----[ || || || || ||| ||| ||| ||| ]----//
//----[ ||| ||| ||| ||| ||| |||| ||| |||| ]----//
//----[ || || || || __________ |||||||||| |||||||||| ]----//
//----[ ||| ||| ||| ||| ||| ||| ||| ]----//
//----[ || || || || ||| || ||| ]----//
//----[ ||| ||| ||| ||| ||| ||| ||| ]----//
//----[ || || || || ||| || ||| ]----//
//----[ ||| ||| ||| ||| ||| ||| ||| ]----//
//----[ ||| ||||| ||| ||| ||| ||| ]----//
//----[ ]----//
//----------------------------------------------------*------------------------------------------------------//
// Kod wygenerowany automatycznie narzêdziem Mrucznik CTL

// ================= UWAGA! =================
//
// WSZELKIE ZMIANY WPROWADZONE DO TEGO PLIKU
// ZOSTAN¥ NADPISANE PO WYWO£ANIU KOMENDY
// > mrucznikctl build
//
// ================= UWAGA! =================


//-------<[ include ]>-------
#include "profiler_impl.pwn"

//-------<[ initialize ]>-------
command_profiler()
{
new command = Command_GetID("profiler");

//aliases


//permissions
Group_SetGlobalCommand(command, true);


//prefix

}

//-------<[ command ]>-------
YCMD:profiler(playerid, params[], help)
{
if (help)
{
sendTipMessage(playerid, "Zarz¹dzanie profilerem.");
return 1;
}
//fetching params
new option[32];
if(sscanf(params, "s[32]", option))
{
sendTipMessage(playerid, "U¿yj /profiler [start|stop|dump|status] ");
return 1;
}

//command body
return command_profiler_Impl(playerid, option);
}
70 changes: 70 additions & 0 deletions gamemodes/modules/admin/commands/profiler/profiler_impl.pwn
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
//-----------------------------------------------<< Source >>------------------------------------------------//
// profiler //
//----------------------------------------------------*------------------------------------------------------//
//----[ ]----//
//----[ ||||| ||||| |||||||||| |||||||||| ]----//
//----[ ||| ||| ||| ||| ||| |||| ||| |||| ]----//
//----[ ||| ||| ||| ||| ||| ||| ||| ||| ]----//
//----[ || || || || ||| ||| ||| ||| ]----//
//----[ ||| ||| ||| ||| ||| |||| ||| |||| ]----//
//----[ || || || || __________ |||||||||| |||||||||| ]----//
//----[ ||| ||| ||| ||| ||| ||| ||| ]----//
//----[ || || || || ||| || ||| ]----//
//----[ ||| ||| ||| ||| ||| ||| ||| ]----//
//----[ || || || || ||| || ||| ]----//
//----[ ||| ||| ||| ||| ||| ||| ||| ]----//
//----[ ||| ||||| ||| ||| ||| ||| ]----//
//----[ ]----//
//----------------------------------------------------*------------------------------------------------------//
// Autor: Mrucznik
// Data utworzenia: 15.03.2020


//

//------------------<[ Implementacja: ]>-------------------
command_profiler_Impl(playerid, option[32])
{
if(!IsPlayerAdmin(playerid))
{
noAccessMessage(playerid);
return 1;
}

if(strcmp(option, "start", true) == 0)
{
Profiler_Start();
SendClientMessage(playerid, 0xFFFFFFFF, "Profilowanie wystartowane.");
return 1;
}
else if(strcmp(option, "stop", true) == 0)
{
Profiler_Stop();
SendClientMessage(playerid, 0xFFFFFFFF, "Profilowanie zatrzymane.");
return 1;
}
else if(strcmp(option, "dump", true) == 0)
{
Profiler_Dump();
SendClientMessage(playerid, 0xFFFFFFFF, "Dump stworzony.");
return 1;
}
else if(strcmp(option, "status", true) == 0)
{
new ProfilerState:s = Profiler_GetState();
switch(s)
{
case PROFILER_DISABLED: SendClientMessage(playerid, 0xFFFFFFFF, "PROFILER_DISABLED");
case PROFILER_ATTACHING: SendClientMessage(playerid, 0xFFFFFFFF, "PROFILER_ATTACHING");
case PROFILER_ATTACHED: SendClientMessage(playerid, 0xFFFFFFFF, "PROFILER_ATTACHED");
case PROFILER_STARTING: SendClientMessage(playerid, 0xFFFFFFFF, "PROFILER_STARTING");
case PROFILER_STARTED: SendClientMessage(playerid, 0xFFFFFFFF, "PROFILER_STARTED");
case PROFILER_STOPPING: SendClientMessage(playerid, 0xFFFFFFFF, "PROFILER_STOPPING");
case PROFILER_STOPPED: SendClientMessage(playerid, 0xFFFFFFFF, "PROFILER_STOPPED");
}
return 1;
}
return 1;
}

//end
Loading

0 comments on commit 5b58150

Please sign in to comment.