#include <a_samp>#define SZIN 0xAAAAAAnew bool:c4[MAX_PLAYERS];new bool:plantc4[MAX_PLAYERS];new bomba;new Float:C4poz[MAX_PLAYERS][3];public OnPlayerConnect(playerid){c4[playerid] = false;plantc4[playerid] = false;return 1;}public OnPlayerCommandText(playerid, cmdtext[]){if(strcmp(cmdtext, \"/buyc4\", true) == 0){ if(c4[playerid] == false) { c4[playerid] = true; SendClientMessage(playerid, SZIN, \"Vettél egy C4-et! /plantc4 a C4 lerakásához!\"); } else { SendClientMessage(playerid, SZIN, \"Már van C4-ed!\");}return 1;}if(strcmp(cmdtext, \"/plantc4\", true) == 0){ if(c4[playerid] == true) { plantc4[playerid] = true; c4[playerid] = false; new Float:X, Float:Y, Float:Z; GetPlayerPos(playerid, X, Y, Z);bomba = CreateObject(1252, X, Y, Z, 0.0, 0.0, 0.0, 0.0);new Float:p[3]; GetPlayerPos(playerid, p[0], p[1], p[2]); C4poz[playerid][0] = p[0]; C4poz[playerid][1] = p[1]; C4poz[playerid][2] = p[2];SendClientMessage(playerid, 0xAAAAAA, \"Leraktad a C4et!\");} else {SendClientMessage(playerid, SZIN, \"Nincs C4ed!\"); }return 1;}if(strcmp(cmdtext, \"/c4\", true) == 0){if(plantc4[playerid] == true){ plantc4[playerid] = false; CreateExplosion(C4poz[playerid][0], C4poz[playerid][1], C4poz[playerid][2], 1, 10); DestroyObject(bomba); SendClientMessage(playerid, SZIN, \"Felrobbantottad a C4et!\"); } else { SendClientMessage(playerid, SZIN, \"Nincs letéve C4\");}return 1;}return 0;}
#include <a_samp>#pragma tabsize 0#define SZIN 0xAAAAAAnew bool:c4[MAX_PLAYERS];new bool:plantc4[MAX_PLAYERS];new bomba;new Float:C4poz[MAX_PLAYERS][3];public OnPlayerConnect(playerid){ c4[playerid] = false; plantc4[playerid] = false; return 1;}public OnPlayerDisconnect(playerid){ c4[playerid] = false; plantc4[playerid] = false; return 1;}public OnPlayerCommandText(playerid, cmdtext[]){ if(strcmp(cmdtext, \"/buyc4\", true) == 0) { if(c4[playerid] == false) return SendClientMessage(playerid, SZIN, \"Már van C4-ed!\"); { c4[playerid] = true; SendClientMessage(playerid, SZIN, \"Vettél egy C4-et! /plantc4 a C4 lerakásához!\"); } return 1; } if(strcmp(cmdtext, \"/plantc4\", true) == 0) { if(c4[playerid] == true) return SendClientMessage(playerid, SZIN, \"Nincs C4ed!\"); { plantc4[playerid] = true; c4[playerid] = false; new Float:X, Float:Y, Float:Z; GetPlayerPos(playerid, X, Y, Z); bomba = CreateObject(1252, X, Y, Z, 0.0, 0.0, 0.0, 0.0); new Float:p[3]; GetPlayerPos(playerid, p[0], p[1], p[2]); C4poz[playerid][0] = p[0]; C4poz[playerid][1] = p[1]; C4poz[playerid][2] = p[2]; SendClientMessage(playerid, 0xAAAAAA, \"Leraktad a C4et!\"); } return 1; } if(strcmp(cmdtext, \"/c4\", true) == 0) { if(plantc4[playerid] == true) return SendClientMessage(playerid, SZIN, \"Nincs letéve C4\"); { plantc4[playerid] = false; CreateExplosion(C4poz[playerid][0], C4poz[playerid][1], C4poz[playerid][2], 1, 10); DestroyObject(bomba); SendClientMessage(playerid, SZIN, \"Felrobbantottad a C4et!\"); } return 1; } return 0;}