Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <sscanf2>
- #include <YSI\y_commands>
- #include <YSI\y_iterate>
- #include <YSI\y_timers>
- #include <YSI\y_bit>
- #include <YSI\y_va>
- #define SCMF va_SendClientMessage
- #define SCMFA va_SendClientMessageToAll
- #define GM va_GameTextForPlayer
- enum pInfo
- {
- pVoucherRare
- }
- new PlayerInfo[MAX_PLAYERS][pInfo];
- enum
- {
- DIALOG_VOUCHERRARE
- };
- main(){}
- stock GetName(playerid)
- {
- new Name[MAX_PLAYER_NAME+1];
- GetPlayerName(playerid, Name, sizeof(Name));
- return Name;
- }
- public OnGameModeInit()
- {
- print("Server > Gamemode-ul ruleaza in parametrii corecti, server pornit!");
- return true;
- }
- public OnGameModeExit()
- {
- return true;
- }
- public OnPlayerConnect(playerid)
- {
- return true;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- return true;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- switch(dialogid)
- {
- case DIALOG_VOUCHERRARE:
- {
- if(response)
- {
- switch(listitem)
- {
- case 0:
- {
- new rand = 5000+ random(30000);
- GivePlayerMoney(playerid, rand);
- SCMF(playerid, -1, "Voucher > Ai primit %d$ din acest voucher, felicitiari %s[%d]!", rand, GetName(playerid), playerid);
- PlayerInfo[playerid][pVoucherRare] -= 1;
- }
- }
- }
- }
- }
- return true;
- }
- public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
- {
- if(!IsPlayerInAnyVehicle(playerid))
- {
- SetPlayerPosFindZ(playerid, Float:fX, Float:fY, Float:fZ);
- }
- else
- {
- new vehicleid = GetPlayerVehicleID(playerid);
- GetPlayerPos(playerid, Float:fX, Float:fY, Float:fZ);
- SetVehiclePos(vehicleid, Float:fX, Float:fY, Float:fZ);
- PutPlayerInVehicle(playerid, vehicleid, 0);
- }
- return true;
- }
- YCMD:myvouchers(playerid, params[], help)
- {
- if(PlayerInfo[playerid][pVoucherRare])
- {
- new string[150], string2[150], stringfinal[200];
- format(string, sizeof(string), "Voucher\tStock");
- format(string2, sizeof(string2), "Voucher Rare\t%d", PlayerInfo[playerid][pVoucherRare]);
- format(stringfinal, sizeof(stringfinal), "%s\n%s", string, string2);
- ShowPlayerDialog(playerid, DIALOG_VOUCHERRARE, DIALOG_STYLE_TABLIST_HEADERS, "Vouchers", stringfinal, "Use", "Cancel");
- return true;
- }
- else if(PlayerInfo[playerid][pVoucherRare] == 0)
- {
- SCMF(playerid, -1, "Comanda > Ne pare rau %s[%d] dar nu aveti niciun Voucher Rar [stock:%d]!", GetName(playerid), playerid, PlayerInfo[playerid][pVoucherRare]);
- return true;
- }
- return true;
- }
- YCMD:spawncar(playerid, params[], help)
- {
- new model, color1, color2, Float:x, Float:y, Float:z;
- if(sscanf(params, "iii", model, color1, color2)) return SendClientMessage(playerid, -1, "Use > /spawncar <model> <color1> <color2>");
- GetPlayerPos(playerid, Float:x, Float:y, Float:z);
- AddStaticVehicle(model, x, y, z, 0, color1, color2);
- PutPlayerInVehicle(playerid, model, 0);
- SCMF(playerid, -1, "Comanda > Felicitiari %s[%d], comanda a fost executata cu succes si ai primit modelul masinii '%d'!", GetName(playerid), playerid, model);
- return true;
- }
- YCMD:givemevoucher(playerid, params[], help)
- {
- PlayerInfo[playerid][pVoucherRare] += 1;
- SCMF(playerid, -1, "Comanda > Felicitiari %s[%d], ai primit gratuit un voucher rar [total:%d]", GetName(playerid), playerid, PlayerInfo[playerid][pVoucherRare]);
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement