25.10.2015, 18:42
I did a system of gifts. Bring a gift and gives me the reward. But when more gives me only 1 reward ...
and
and
https://www.youtube.com/watch?v=JudNM0PzeXM
Video
Код HTML:
CMD:oplace(playerid, params[]) { if(playerVariables[playerid][pAdminLevel] < 1) return SCM(playerid,COLOR_WHITE,AdminOnly); if(moneybag >= 15) return SCM(playerid,COLOR_WHITE,"{FFB870}Is already active event."); new am,name[25],string[184]; if(sscanf(params, "d",am)) return SendClientMessage(playerid, COLOR_WHITE,"Syntax: /oplace [money]"); if(am < 1 || am > 5000000) return SCM(playerid, COLOR_WHITE,"{FFB870}Ammount maxim is 1 - 5,000,000."); GetPlayerName(playerid,name,sizeof(name)); moneybag = 10; new Float: x,Float: y,Float: z; GetPlayerPos(playerid,x,y,z); moneybagp = CreatePickup(19054, 2, x+5,y,z, -1); moneybagprem = 1; moneybagpr2 = am; format(string, sizeof(string), "Admin %s started an event. Object: 19054, prize: %d",name, moneybagpr2); submitToHelpersAndAdmins(string, COLOR_RED); return 1; }
Код HTML:
public OnPlayerPickUpPickup(playerid, pickupid) { if(pickupid == moneybagp) { if(moneybag > 1) { moneybag--; format(gString, sizeof(gString), "NR AdmBot: Un obiect din event a fost gasit de %s. Acesta a castigat un premiu de %d!", GetName(playerid), moneybagpr2); SendClientMessageToAll(COLOR_HOTORANGE, gString); format(gString, sizeof(gString), "NR AdmBot: Mai sunt %d cadouri de gasit!", moneybag); SendClientMessageToAll(COLOR_HOTORANGE, gString); format(gString, sizeof(gString), "(!) Felicitari! Ai gasit premiul in valoare de %d!", moneybagpr2); SendClientMessageToAll(COLOR_LIGHT, gString); playerVariables[playerid][pMoney] += moneybagpr2; } } return 1; }
Код HTML:
case 2014: { new string[256]; format(string, sizeof(string), "NR AdmBot: Un obiect din event a fost gasit de %s. Acesta a castigat un premiu de %d!",GetName(playerid),NumberFormat(moneybagpr2)); SendClientMessageToAll(COLOR_HOTORANGE, string); SendClientMessageToAll(COLOR_HOTORANGE, "NR AdmBot: Mai sunt %d cadouri de gasit!", moneybag); playerVariables[playerid][pMoney] += moneybagpr2; moneybag = 0; moneybagprem = 0; moneybagpr2 = 0; }
Video