Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <dini>
- #include <zcmd>
- #include <mSelection>
- forward SaveThisPickUp(pickupid);
- forward LoadPickUp();
- forward SendAdminMesaj(color,const string[]);
- new pickups = mS_INVALID_LISTID;
- new maxpickups = 100;
- enum PickupData
- {
- Model,
- Float:Locatiex,
- Float:Locatiey,
- Float:Locatiez,
- }
- new PickUpInfo[MAX_PLAYERS][PickupData];
- public OnGameModeInit()
- {
- pickups = LoadModelSelectionMenu("pickup's.txt");
- return 1;
- }
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Pick-up Creator by Gireada");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- main()
- {
- print("\n----------------------------------");
- print(" Pick-up Creator by Gireada");
- print("----------------------------------\n");
- }
- CMD:clanhelp(playerid, params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- ShowModelSelectionMenu(playerid, pickups, "PickUp");
- }
- return 1;
- }
- public LoadPickUp()
- {
- new file[50];
- for(new idx=1;idx<maxpickups;idx++)
- {
- format(file, sizeof(file),"Pickup/%d.ini", idx);
- if(dini_Exists(file))
- {
- PickUpInfo[idx][Model] = dini_Int(file,"Model");
- PickUpInfo[idx][Locatiex] = dini_Float(file,"Locatiex");
- PickUpInfo[idx][Locatiey] = dini_Float(file,"Locatiey");
- PickUpInfo[idx][Locatiez] = dini_Float(file,"Locatiez");
- CreatePickup(PickUpInfo[idx][Model], 1, PickUpInfo[idx][Locatiex], PickUpInfo[idx][Locatiey], PickUpInfo[idx][Locatiez], -1);
- }
- }
- return 1;
- }
- public SaveThisPickUp(pickupid)
- {
- new file2[50];
- format(file2, sizeof(file2),"Pickup/%d.ini", pickupid);
- dini_Create(file2);
- dini_IntSet(file2,"Model",PickUpInfo[pickupid][Model]);
- dini_FloatSet(file2,"Locatiex",PickUpInfo[pickupid][Locatiex]);
- dini_FloatSet(file2,"Locatiey",PickUpInfo[pickupid][Locatiey]);
- dini_FloatSet(file2,"Locatiez",PickUpInfo[pickupid][Locatiez]);
- return 1;
- }
- public OnPlayerModelSelection(playerid, response, listid, modelid)
- {
- new Float:x, Float:y, Float:z, string[700], name[MAX_PLAYER_NAME], file2[100];
- GetPlayerName(playerid, name, sizeof(name));
- if(listid == pickups)
- {
- GetPlayerPos(playerid, x,y,z);
- if(response)
- {
- for(new i=1;i<MAX_PLAYERS; i++)
- {
- format(file2, sizeof(file2),"Pickup/%d.ini", i);
- if(!dini_Exists(file2))
- {
- PickUpInfo[i][Model] = modelid;
- PickUpInfo[i][Locatiex] = x;
- PickUpInfo[i][Locatiey] = y;
- PickUpInfo[i][Locatiez] = z;
- CreatePickup(PickUpInfo[i][Model], 1, PickUpInfo[i][Locatiex], PickUpInfo[i][Locatiey], PickUpInfo[i][Locatiez], -1);
- format(string, sizeof(string), "Admin-ul %s a creiat pick-ul %d",name,i);
- SendAdminMesaj(0xFFFFFFFF,string); SaveThisPickUp(i);
- break;
- }
- }
- }
- else SendClientMessage(playerid, 0xFF0000FF, "Cancel pickpu selection");
- return 1;
- }
- return 1;
- }
- public SendAdminMesaj(color,const string[])
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(IsPlayerAdmin(i))
- {
- SendClientMessage(i, color, string);
- printf("%s", string);
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement