Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:lightfire(playerid,params[])
- {
- if(AccountInfo[playerid][pMatches] == 0)
- {
- SendClientMessage(playerid, RED, "[Database:]{FFFFFF} You dont have any matches");
- return 1;
- }
- if(AccountInfo[playerid][pWood] == 0)
- {
- SendClientMessage(playerid, RED, "[Database:]{FFFFFF} You dont have any firewood");
- return 1;
- }
- if(MadeFire[playerid] == 1)
- {
- SendClientMessage(playerid, RED, "[Database:]{FFFFFF} You already have fire burning");
- return 1;
- }
- new message = random(3);
- if(message == 0)
- {
- GameTextForPlayer(playerid, "You failed to light up the fire", 3500, 5);
- new string[158];
- new sendername[MAX_PLAYER_NAME];
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string, sizeof(string), "%s failed to light up the fire", sendername);
- ProxDetector(30.0, playerid, string, COLOR_GREEN,COLOR_GREEN,COLOR_GREEN,COLOR_GREEN,COLOR_GREEN);
- AccountInfo[playerid][pMatches] -= 1;
- AccountInfo[playerid][pSlotsFree] -= 1;
- }
- else if(message == 1)
- {
- GameTextForPlayer(playerid, "You get the fire going....", 3500, 5);
- new string[158];
- new sendername[MAX_PLAYER_NAME];
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string, sizeof(string), "%s takes some wood and put it on the ground, and starts to make a fire", sendername);
- ProxDetector(30.0, playerid, string, COLOR_GREEN,COLOR_GREEN,COLOR_GREEN,COLOR_GREEN,COLOR_GREEN);
- AccountInfo[playerid][pMatches] -= 1;
- AccountInfo[playerid][pWood] -= 1;
- new Float:x,Float:y,Float:z;
- GetPlayerPos(playerid,x,y,z);
- AccountInfo[playerid][pSlotsFree] -= 2;
- fire[playerid] = CreateDynamicObject(1463, x, y, z - 1, 0.0, 0.0, 0.0);
- fire[playerid] = CreateObject(18688, x, y, z - 2.5, 0.0, 0.0, 0.0);
- MadeFire[playerid] = 1;
- SetTimerEx("fireout", 15000, false, "i", playerid);
- }
- else if(message == 2)
- {
- GameTextForPlayer(playerid, "You succeed in lighting up the fire", 3500, 5);
- new string[158];
- new sendername[MAX_PLAYER_NAME];
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string, sizeof(string), "%s takes some wood and put it on the ground, and starts to make a fire", sendername);
- ProxDetector(30.0, playerid, string, COLOR_GREEN,COLOR_GREEN,COLOR_GREEN,COLOR_GREEN,COLOR_GREEN);
- AccountInfo[playerid][pMatches] -= 1;
- AccountInfo[playerid][pWood] -= 1;
- new Float:x,Float:y,Float:z;
- GetPlayerPos(playerid,x,y,z);
- AccountInfo[playerid][pSlotsFree] -= 2;
- fire[playerid] = CreateDynamicObject(1463, x, y, z - 1, 0.0, 0.0, 0.0);
- fire[playerid] = CreateObject(18688, x, y, z - 2.5, 0.0, 0.0, 0.0);
- MadeFire[playerid] = 1;
- SetTimerEx("fireout", 15000, false, "i", playerid);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement