Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- scripted orginally created by Spanes.
- */
- #include <a_samp>
- #include <mSelection>
- #pragma tabsize 0
- main() { print("Spanes Clothing System v1.0"); }
- new aksesuarliste = mS_INVALID_LISTID;
- new AksesuarUcreti[MAX_PLAYERS];
- new SectigiAksesuar[MAX_PLAYERS];
- new slot[MAX_PLAYERS][6];
- new AksesuarVerileri[152][]=
- {
- {18891,25},
- {18892,25},
- {18893,25},
- {18894,25},
- {18895,25},
- {18896,25},
- {18897,25},
- {18898,25},
- {18899,25},
- {18900,30},
- {18901,30},
- {18902,35},
- {18903,35},
- {18904,25},
- {18905,40},
- {18921,50},
- {18922,35},
- {18923,25},
- {18924,45},
- {18939,40},
- {18940,55},
- {18941,65},
- {18942,20},
- {18943,25},
- {18955,30},
- {18956,35},
- {18957,40},
- {18958,40},
- {18959,35},
- {18926,30},
- {18927,25},
- {18928,20},
- {18929,20},
- {18930,25},
- {18931,35},
- {18932,30},
- {18933,30},
- {18934,45},
- {18935,50},
- {18969,55},
- {18968,45},
- {19067,55},
- {19068,55},
- {19069,40},
- {19095,35},
- {18962,30},
- {19096,25},
- {19097,30},
- {19098,35},
- {18944,30},
- {18945,25},
- {18946,20},
- {18947,30},
- {18948,35},
- {18949,45},
- {18950,25},
- {18951,20},
- {18970,25},
- {18971,30},
- {18972,35},
- {18973,30},
- {19006,25},
- {19007,45},
- {19008,40},
- {19009,30},
- {19010,35},
- {19011,30},
- {19012,25},
- {19013,20},
- {19014,25},
- {19015,45},
- {19016,30},
- {19017,35},
- {19018,30},
- {19019,25},
- {19020,30},
- {18936,30},
- {18937,35},
- {18938,25},
- {18977,35},
- {18978,40},
- {18979,35},
- {18911,35},
- {18912,45},
- {18913,40},
- {18914,25},
- {18915,30},
- {18916,35},
- {18917,30},
- {18918,25},
- {18919,20},
- {18920,25},
- {19036,30},
- {19037,35},
- {19038,40},
- {18974,25},
- {19163,30},
- {19317,250},
- {19318,250},
- {19319,250},
- {19039,20},
- {19040,20},
- {19041,20},
- {19042,20},
- {19043,20},
- {19044,20},
- {19045,20},
- {19046,20},
- {19047,20},
- {19048,20},
- {19049,20},
- {19050,20},
- {19051,20},
- {19052,20},
- {19053,20},
- {19421,15},
- {19422,15},
- {19423,15},
- {19424,15},
- {19487,25},
- {19488,25},
- {1210,15},
- {371,20}, // -
- {18952,10},
- {18953,20},
- {18954,20},
- {18961,10},
- {18962,20},
- {19022,25},
- {19023,25},
- {19024,25},
- {19025,25},
- {19026,25},
- {19027,25},
- {19028,25},
- {19029,25},
- {19030,25},
- {19031,25},
- {19032,25},
- {19033,25},
- {19034,25},
- {19035,25},
- {18906,30},
- {18907,30},
- {18908,30},
- {18910,30},
- {19065,30},
- {19101,30},
- {19102,30},
- {19103,30},
- {19104,30},
- {19105,30}
- };
- public OnGameModeInit()
- {
- SetGameModeText("Spanes Scripting");
- AddPlayerClass(0, 2912.8022,-940.3574,10.7524, 269.1425, 0, 0, 0, 0, 0, 0);
- aksesuarliste = LoadModelSelectionMenu("spanes.txt");
- return 1;
- }
- public OnPlayerModelSelection(playerid, response, listid, modelid)
- {
- if(listid == aksesuarliste)
- {
- if(response)
- {
- new aksesuarucret;
- for(new i = 0; i < sizeof(AksesuarVerileri) ; i++)
- {
- if(modelid == AksesuarVerileri[i][0])
- {
- aksesuarucret = AksesuarVerileri[i][1];
- }
- }
- new test[128];
- format(test, sizeof(test),"Accessory: %d | Price: %d$\nDo you want to buy?",modelid,aksesuarucret);
- ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX, "Accessory",test,"Yes", "No");
- SectigiAksesuar[playerid] = modelid;
- AksesuarUcreti[playerid] = aksesuarucret;
- }
- return 1;
- }
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- GivePlayerMoney(playerid, 5000);
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(strcmp("/buy", cmdtext, true, 10) == 0)
- {
- ShowModelSelectionMenu(playerid,aksesuarliste, "Slymind");
- return 1;
- }
- if(strcmp("/accessory", cmdtext, true, 10) == 0)
- {
- ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, "Accessory","1\n2\n3\n4\n5\n6","Choose","Close");
- return 1;
- }
- return 0;
- }
- enum attached_object_data
- {
- ao_model,
- ao_bone,
- Float:ao_x,
- Float:ao_y,
- Float:ao_z,
- Float:ao_rx,
- Float:ao_ry,
- Float:ao_rz,
- Float:ao_sx,
- Float:ao_sy,
- Float:ao_sz
- }
- new ao[MAX_PLAYERS][MAX_PLAYER_ATTACHED_OBJECTS][attached_object_data];
- public OnPlayerEditAttachedObject(playerid, response, index, modelid, boneid, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fScaleX, Float:fScaleY, Float:fScaleZ)
- {
- if(response)
- {
- SendClientMessage(playerid, -1, "Attached object edition saved.");
- ao[playerid][index][ao_x] = fOffsetX;
- ao[playerid][index][ao_y] = fOffsetY;
- ao[playerid][index][ao_z] = fOffsetZ;
- ao[playerid][index][ao_rx] = fRotX;
- ao[playerid][index][ao_ry] = fRotY;
- ao[playerid][index][ao_rz] = fRotZ;
- ao[playerid][index][ao_sx] = fScaleX;
- ao[playerid][index][ao_sy] = fScaleY;
- ao[playerid][index][ao_sz] = fScaleZ;
- }
- else
- {
- SendClientMessage(playerid,-1, "Attached object edition not saved.");
- new i = index;
- SetPlayerAttachedObject(playerid, index, modelid, boneid, ao[playerid][i][ao_x], ao[playerid][i][ao_y], ao[playerid][i][ao_z], ao[playerid][i][ao_rx], ao[playerid][i][ao_ry], ao[playerid][i][ao_rz], ao[playerid][i][ao_sx], ao[playerid][i][ao_sy], ao[playerid][i][ao_sz]);
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == 3)
- {
- if(response)
- {
- switch(listitem)
- {
- case 0:
- {
- if(slot[playerid][0] == 0)
- {
- SendClientMessage(playerid,-1,"You did not buy anything for this slot");
- return 1;
- }
- SetPlayerAttachedObject(playerid, 0,slot[playerid][0], 2, 0.101, -0.0, 0.0, 5.50, 84.60, 83.7, 1, 1, 1);
- EditAttachedObject(playerid, 0);
- }
- case 1:
- {
- if(slot[playerid][1] == 0)
- {
- SendClientMessage(playerid,-1,"You did not buy anything for this slot");
- return 1;
- }
- SetPlayerAttachedObject(playerid, 1,slot[playerid][1], 2, 0.101, -0.0, 0.0, 5.50, 84.60, 83.7, 1, 1, 1);
- EditAttachedObject(playerid, 1);
- }
- case 2:
- {
- if(slot[playerid][2] == 0)
- {
- SendClientMessage(playerid,-1,"You did not buy anything for this slot");
- return 1;
- }
- SetPlayerAttachedObject(playerid, 2,slot[playerid][2], 2, 0.101, -0.0, 0.0, 5.50, 84.60, 83.7, 1, 1, 1);
- EditAttachedObject(playerid, 2);
- }
- case 3:
- {
- if(slot[playerid][3] == 0)
- {
- SendClientMessage(playerid,-1,"You did not buy anything for this slot");
- return 1;
- }
- SetPlayerAttachedObject(playerid, 3,slot[playerid][3], 2, 0.101, -0.0, 0.0, 5.50, 84.60, 83.7, 1, 1, 1);
- EditAttachedObject(playerid, 3);
- }
- case 4:
- {
- if(slot[playerid][4] == 0)
- {
- SendClientMessage(playerid,-1,"You did not buy anything for this slot");
- return 1;
- }
- SetPlayerAttachedObject(playerid, 4,slot[playerid][4], 2, 0.101, -0.0, 0.0, 5.50, 84.60, 83.7, 1, 1, 1);
- EditAttachedObject(playerid, 4);
- }
- case 5:
- {
- if(slot[playerid][5] == 0)
- {
- SendClientMessage(playerid,-1,"You did not buy anything for this slot");
- return 1;
- }
- SetPlayerAttachedObject(playerid, 5,slot[playerid][5], 2, 0.101, -0.0, 0.0, 5.50, 84.60, 83.7, 1, 1, 1);
- EditAttachedObject(playerid, 5);
- }
- }
- }
- }
- if(dialogid == 1)
- {
- if(response)
- {
- if(GetPlayerMoney(playerid) >= AksesuarUcreti[playerid])
- {
- new slymindstr[128];
- format(slymindstr,sizeof(slymindstr),"Slot 1: %d\nSlot 2: %d\nSlot 3: %d\nSlot 4: %d\nSlot 5: %d\nSlot 6: %d",slot[playerid][0],slot[playerid][1],slot[playerid][2],slot[playerid][3],slot[playerid][4],slot[playerid][5]);
- ShowPlayerDialog(playerid,2,DIALOG_STYLE_LIST,"Slot",slymindstr,"Seç","");
- }
- else
- {
- SendClientMessage(playerid,-1,"You dont have enough money!");
- }
- }
- }
- else if(dialogid == 2)
- {
- if(response)
- {
- switch(listitem)
- {
- case 0: slot[playerid][0] = SectigiAksesuar[playerid];
- case 1: slot[playerid][1] = SectigiAksesuar[playerid];
- case 2: slot[playerid][2] = SectigiAksesuar[playerid];
- case 3: slot[playerid][3] = SectigiAksesuar[playerid];
- case 4: slot[playerid][4] = SectigiAksesuar[playerid];
- case 5: slot[playerid][5] = SectigiAksesuar[playerid];
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement