Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <sscanf>
- #include <zcmd>
- #define COLOR_LIGHTRED 0xFF6347AA
- #define COLOR_RED 0xAA3333AA
- #define COLOR_WHITE 0xFFFFFFAA
- CMD:jetpack(playerid, params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new string[128], target;
- if(sscanf(params, "ds", target)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /jetpack [playerid/partofname]");
- if(GetPlayerSpecialAction(target) == SPECIAL_ACTION_USEJETPACK) return SendClientMessage(playerid, COLOR_WHITE, "Player already have a jetpack.");
- if(!IsPlayerConnected(target)) return SendClientMessage(playerid, COLOR_WHITE, "Player is not connected.");
- if(target != INVALID_PLAYER_ID)
- {
- if(IsPlayerAdmin(playerid))
- {
- SendClientMessage(target, COLOR_WHITE, "Enjoy your new jetpack!");
- SetPlayerSpecialAction(target, SPECIAL_ACTION_USEJETPACK);
- format(string,sizeof(string),"%s (%d) has received a jetpack from Administrator %s (%d).", PlayerName(target),target,PlayerName(playerid),playerid);
- SendClientMessageToAll(COLOR_LIGHTRED,string);
- }
- else SendClientMessage(playerid, COLOR_RED,"You're not authorized to use this command !");
- }
- else SendClientMessage(playerid, COLOR_WHITE, "Invalid player specified.");
- }
- else SendClientMessage(playerid, COLOR_RED,"You're not authorized to use this command !");
- return 1;
- }
- CMD:removejetpack(playerid, params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new string[128], target;
- if(sscanf(params, "ds", target)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /removejetpack [playerid]");
- if(!IsPlayerConnected(target)) return SendClientMessage(playerid, COLOR_WHITE, "Player is not connected.");
- if(GetPlayerSpecialAction(target) == SPECIAL_ACTION_NONE) return SendClientMessage(playerid, COLOR_WHITE, "Player don't have any jetpack.");
- SetPlayerSpecialAction(target,SPECIAL_ACTION_NONE);
- format(string,sizeof(string),"Administrator %s (%d) has removed a jetpack on %s (%d).",PlayerName(playerid),playerid,PlayerName(target),target);
- SendClientMessageToAll(COLOR_LIGHTRED,string);
- }
- else SendClientMessage(playerid, COLOR_RED,"You're not authorized to use this command !");
- return 1;
- }
- CMD:slap(playerid, params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new target,string[128];
- if(sscanf(params, "ds", target)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /slap [playerid/partofname]");
- if(!IsPlayerConnected(target)) return SendClientMessage(playerid, -1, "Player is not connected.");
- new Float:slx, Float:sly, Float:slz;
- GetPlayerPos(target, slx, sly, slz);
- SetPlayerPos(target, slx, sly, slz+6);
- PlayerPlaySound(target, 1130, slx, sly, slz+5);
- format(string,sizeof(string),"Administrator %s (%d) has slapped %s (%d).",PlayerName(playerid),playerid,PlayerName(target),target);
- SendClientMessageToAll(COLOR_LIGHTRED,string);
- }
- else SendClientMessage(playerid, COLOR_RED,"You're not authorized to use this command !");
- return 1;
- }
- CMD:akill(playerid, params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new target,string[128];
- if(sscanf(params, "d", target)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: [playerid/partofname]");
- if(!IsPlayerConnected(target)) return SendClientMessage(playerid, -1, "Player is not connected.");
- SetPlayerHealth(target,0);
- format(string,sizeof(string),"Administrator %s (%d) has killed you.",PlayerName(playerid),playerid);
- SendClientMessage(target,COLOR_WHITE,string);
- format(string,sizeof(string),"Administrator %s (%d) has used /akill on %s (%d).",PlayerName(playerid),playerid,PlayerName(target),target);
- SendClientMessageToAll(COLOR_LIGHTRED,string);
- }
- else SendClientMessage(playerid, COLOR_RED,"You're not authorized to use this command !");
- return 1;
- }
- CMD:givemoney(playerid, params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new target,money,string[128];
- if(sscanf(params, "di", target,money)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givemoney [playerid/partofname][amount]");
- if(!IsPlayerConnected(target)) return SendClientMessage(playerid, -1, "Player is not connected.");
- GivePlayerMoney(target, money);
- format(string,sizeof(string),"Administrator %s (%d) has given you $%d .",PlayerName(playerid),playerid,money);
- SendClientMessage(target,COLOR_WHITE,string);
- format(string,sizeof(string),"Administrator %s (%d) has given $%d money to %s (%d).",PlayerName(playerid),playerid,money,PlayerName(target),target);
- SendClientMessageToAll(COLOR_LIGHTRED,string);
- }
- else SendClientMessage(playerid, COLOR_RED,"You're not authorized to use this command !");
- return 1;
- }
- CMD:setmoney(playerid, params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new target,money,string[128];
- if(sscanf(params, "di", target,money)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setmoney [playerid/partofname] [amount])");
- if(!IsPlayerConnected(target)) return SendClientMessage(playerid, -1, "Player is not connected.");
- ResetPlayerMoney(target);
- GivePlayerMoney(target, money);
- format(string,sizeof(string),"Administrator %s (%d) has setted your money to %d.",PlayerName(playerid),playerid,money);
- SendClientMessage(target,COLOR_WHITE,string);
- format(string,sizeof(string),"Administrator %s (%d) has setted %s (%d) money to %d.",PlayerName(playerid),playerid,PlayerName(target),target,money);
- SendClientMessageToAll(COLOR_LIGHTRED,string);
- }
- else SendClientMessage(playerid, COLOR_RED,"You're not authorized to use this command !");
- return 1;
- }
- CMD:giveweapon(playerid, params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new target,gun,ammo,string[128];
- if(sscanf(params, "dii", target,gun,ammo)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /giveweapon [playerid/partofname] [weapon] [ammo]");
- if(!IsPlayerConnected(target)) return SendClientMessage(playerid, -1, "{F81414}Error: {FFFFFF}Player is not connected.");
- GivePlayerWeapon(target, gun,ammo);
- format(string,sizeof(string),"Administrator %s (%d) has given you weapon (Id: %d) (Ammo: %d).",PlayerName(playerid),playerid,gun,ammo);
- SendClientMessage(target,COLOR_WHITE,string);
- format(string,sizeof(string),"Administrator %s (%d) has given %s (%d) (Weapon ID: %d) (Ammo: %d).",PlayerName(playerid),playerid,PlayerName(target),target,gun,ammo);
- SendClientMessageToAll(COLOR_LIGHTRED,string);
- }
- else SendClientMessage(playerid, COLOR_RED,"You're not authorized to use this command !");
- return 1;
- }
- CMD:setscore(playerid, params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new target,string[128],score;
- if(sscanf(params, "dd", target,score)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /setscore [playerid/partofname] [amount]");
- if(!IsPlayerConnected(target)) return SendClientMessage(playerid, -1, "Player is not connected.");
- format(string,sizeof(string),"Administrator %s (%d) has setted your score to %d.",PlayerName(playerid),playerid,score);
- SendClientMessage(target,COLOR_WHITE,string);
- format(string,sizeof(string),"Administrator %s (%d) has setted %s (%d) score to %d.",PlayerName(playerid),playerid,PlayerName(target),target,score);
- SendClientMessageToAll(COLOR_LIGHTRED,string);
- SetPlayerScore(target, score);
- }
- else SendClientMessage(playerid, COLOR_RED,"You're not authorized to use this command !");
- return 1;
- }
- CMD:setweather(playerid, params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new string[128],weather;
- if(sscanf(params, "i", weather)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setweather [weatherid]");
- if(weather > 45 || weather < 0) return SendClientMessage(playerid, COLOR_RED, "Invalid weather ID.");
- format(string,sizeof(string),"Administrator %s (%d) has setted all players weather to %d.",PlayerName(playerid),playerid,weather);
- SendClientMessageToAll(COLOR_LIGHTRED,string);
- SetWeather(weather);
- }
- else SendClientMessage(playerid, COLOR_RED,"You're not authorized to use this command !");
- return 1;
- }
- CMD:givescore(playerid, params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new target,score,string[128];
- if(sscanf(params, "di", target,score)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givescore [playerid] [amount]");
- if(!IsPlayerConnected(target)) return SendClientMessage(playerid, -1, "Player is not connected.");
- GivePlayerScore(target, score);
- format(string,sizeof(string),"Administrator %s (%d) has given you %d score.",PlayerName(playerid),playerid,score);
- SendClientMessage(target,COLOR_WHITE,string);
- format(string,sizeof(string),"Administrator %s (%d) has given %d score to %s (%d).",PlayerName(playerid),playerid, score,PlayerName(target),target);
- SendClientMessageToAll(COLOR_LIGHTRED,string);
- }
- else SendClientMessage(playerid, COLOR_RED,"You're not authorized to use this command !");
- return 1;
- }
- CMD:disarm(playerid, params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new target,string[128];
- if(sscanf(params, "d",target)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /disarm [playerid/partofname]");
- if(!IsPlayerConnected(target)) return SendClientMessage(playerid, COLOR_WHITE, "Player is not connected.");
- format(string,sizeof(string),"Administrator %s (%d) has disarmed %s (%d).",PlayerName(playerid),playerid,PlayerName(target),target);
- SendClientMessageToAll(COLOR_LIGHTRED,string);
- ResetPlayerWeapons(target);
- }
- else SendClientMessage(playerid, COLOR_RED,"You're not authorized to use this command !");
- return 1;
- }
- CMD:explode(playerid, params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new target,string[128];
- if(sscanf(params, "d", target)) return SendClientMessage(playerid, -1, "USAGE: /explode [playerid/partofname]");
- if(!IsPlayerConnected(target)) return SendClientMessage(playerid, -1, "Player is not connected.");
- ExplodePlayer(target);
- format(string,sizeof(string),"Administrator %s (%d) has exploded you.",PlayerName(playerid),playerid);
- SendClientMessage(target,COLOR_WHITE,string);
- format(string,sizeof(string),"Administrator %s (%d) has exploded %s (%d).",PlayerName(playerid),playerid,PlayerName(target),target);
- SendClientMessageToAll(COLOR_LIGHTRED,string);
- }
- else SendClientMessage(playerid, COLOR_RED,"You're not authorized to use this command !");
- return 1;
- }
- CMD:freeze(playerid, params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new string[128],target;
- if(sscanf(params, "ds", target)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /freeze [playerid/partofname]");
- if(!IsPlayerConnected(target)) return SendClientMessage(playerid, COLOR_WHITE, "Player is not connected.");
- format(string,sizeof(string),"Administrator %s (%d) has freezed %s (%d).",PlayerName(playerid),playerid,PlayerName(target),target);
- SendClientMessageToAll(COLOR_LIGHTRED,string);
- TogglePlayerControllable(target, 0);
- GameTextForPlayer(target, "~r~Frozen!", 2000, 3);
- }
- else SendClientMessage(playerid, COLOR_RED,"You're not authorized to use this command !");
- return 1;
- }
- CMD:unfreeze(playerid, params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new string[128],target;
- if(sscanf(params, "ds", target)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /unfreeze [playerid/partofname]");
- if(!IsPlayerConnected(target)) return SendClientMessage(playerid, COLOR_WHITE, "Player is not connected.");
- format(string,sizeof(string),"Administrator %s (%d) has unfreezed %s (%d).",PlayerName(playerid),playerid,PlayerName(target),target);
- SendClientMessageToAll(COLOR_LIGHTRED,string);
- TogglePlayerControllable(target, 1);
- GameTextForPlayer(target, "~r~Unfrozen!", 2000, 3);
- }
- else SendClientMessage(playerid, COLOR_RED,"You're not authorized to use this command !");
- return 1;
- }
- CMD:setskin(playerid, params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new target,skin,string[128];
- if(sscanf(params, "di", target,skin)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setskin [playerid/partofname] [skinid]");
- if(!IsPlayerConnected(target)) return SendClientMessage(playerid, COLOR_WHITE, "Player is not connected.");
- if(GetPlayerSkin(target) == skin) SendClientMessage(playerid, COLOR_WHITE, "Player is already wearing the skin you choose.");
- SetPlayerSkin(target,skin);
- format(string,sizeof(string),"Administrator %s (%d) has setted %s (%d) skin to %d.",PlayerName(playerid),playerid,PlayerName(target),target,skin);
- SendClientMessageToAll(COLOR_LIGHTRED,string);
- }
- else SendClientMessage(playerid, COLOR_RED,"You're not authorized to use this command !");
- return 1;
- }
- CMD:kick(playerid, params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new string[128], target, reason[48];
- if(sscanf(params, "ds[48]", target, reason)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /kick [playerid/partofname] [reason]");
- if(!IsPlayerConnected(target)) return SendClientMessage(playerid, COLOR_WHITE, "Player is not connected.");
- format(string,sizeof(string),"Administrator %s (%d) has kicked %s (%d). (Reason: %s)",PlayerName(playerid),playerid,PlayerName(target),target,reason);
- SendClientMessageToAll(COLOR_LIGHTRED,string);
- SetTimerEx("KickTimer", 1000, false, "i", playerid);
- }
- else SendClientMessage(playerid, COLOR_RED,"You're not authorized to use this command !");
- return 1;
- }
- CMD:get(playerid, params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new target,string[128];
- new Float:x,Float:y,Float:z;
- GetPlayerPos(playerid,x,y,z);
- if(!IsPlayerConnected(target)) return SendClientMessage(playerid, -1, "Player is not connected.");
- if(sscanf(params, "i",target)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /get [playerid/partofname]");
- if(target == playerid) return SendClientMessage(playerid, -1, "You cannot /get yourself.");
- SetPlayerPos(target, x,y,z);
- SetPlayerInterior(target,GetPlayerInterior(playerid));
- new Interior = GetPlayerInterior(target);
- if(IsPlayerInAnyVehicle(playerid))
- {
- new Car = GetPlayerVehicleID(playerid);
- SetVehiclePos(GetPlayerVehicleID(target), x+ 1, y+ 1, z);
- LinkVehicleToInterior(GetPlayerVehicleID(target),Interior);
- PutPlayerInVehicle(target, (Car), 0);
- }
- format(string,sizeof(string),"Administrator %s (%d) has teleported you to his/her position.",PlayerName(playerid),playerid);
- SendClientMessage(target,COLOR_WHITE,string);
- format(string,sizeof(string),"Administrator %s (%d) has teleported %s (%d) to his/her position.",PlayerName(playerid),playerid,PlayerName(target),target);
- SendClientMessageToAll(COLOR_LIGHTRED,string);
- }
- else SendClientMessage(playerid, COLOR_RED,"You're not authorized to use this command !");
- return 1;
- }
- forward KickTimer(playerid);
- public KickTimer(playerid)
- {
- Kick(playerid);
- return 1;
- }
- stock GivePlayerScore(playerid, score)
- {
- SetPlayerScore(playerid, GetPlayerScore(playerid)+score);
- return 1;
- }
- stock ExplodePlayer(playerid)
- {
- new Float:Pos[3];
- GetPlayerPos(playerid,Pos[0], Pos[1], Pos[2]);
- CreateExplosion(Pos[0], Pos[1], Pos[2], 7, 10);
- }
- stock PlayerName(playerid)
- {
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- return name;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement