- #include <a_samp>
- #include <zcmd>
- #define COLOR_RED 0xAA3333AA
- #define COLOR_GREEN 0x33AA33AA
- new UsingCamo;
- new OnCamoCooldown;
- forward CamoCooldown(playerid);
- forward CamoTimer(playerid);
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Blank Filterscript by your name here");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- #else
- main()
- {
- print("\n----------------------------------");
- print(" Blank Gamemode by your name here");
- print("----------------------------------\n");
- }
- #endif
- public OnGameModeInit()
- {
- // Don't use these lines if it's a filterscript
- SetGameModeText("Blank Script");
- AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
- return 1;
- }
- public OnGameModeExit()
- {
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- return 1;
- }
- public OnVehicleSpawn(vehicleid)
- {
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/mycommand", cmdtext, true, 10) == 0)
- {
- // Do something here
- return 1;
- }
- return 0;
- }
- stock randomEx(minnum = cellmin, maxnum = cellmax) return random(maxnum - minnum + 1) + minnum;
- CMD:camo(playerid, params[])
- {
- if(UsingCamo == 0)
- {
- if(OnCamoCooldown == 0)
- {
- new Vw = randomEx(1,5);
- SetPlayerVirtualWorld(playerid, Vw);
- SetTimerEx("CamoTimer", 10000, false, "i", playerid);
- SetTimerEx("CamoCooldown", 100000, false, "i", playerid);
- UsingCamo = 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "<!>You are on a cooldown!");
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "<!>You are currently using it already!");
- }
- return 1;
- }
- public CamoCooldown(playerid)
- {
- SendClientMessage(playerid, COLOR_GREEN, "<!>Your camo timer has expired. You can now use it again!");
- OnCamoCooldown = 0;
- return 1;
- }
- public CamoTimer(playerid)
- {
- SetPlayerVirtualWorld(playerid, 0);
- UsingCamo = 0;
- SendClientMessage(playerid, COLOR_GREEN, "<!>Your camo has expired!");
- return 1;
- }