Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <G_ObjectsRot>
- #pragma tabsize 0
- main()
- {
- print("\n----------------------------------");
- print(" Blank Gamemode by your name here");
- print("----------------------------------\n");
- }
- new bool:open[SERVER_OBJECTS] = false;
- public OnGameModeInit()
- {
- SetGameModeText("Blank Script");
- AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
- CreateObject(5004,1124.458,-2557.726,1.848,0.0,0.0,-180.000);
- CreateObject(5706,1204.238,-2587.184,4.300,0.0,0.0,90.000);
- CreateObject(5706,1204.261,-2545.279,3.700,0.0,0.0,90.000);
- CreateObject(5706,1171.207,-2587.926,4.575,0.0,0.0,90.000);
- CreateObject(5706,1171.226,-2548.168,4.600,0.0,0.0,90.000);
- CreateObject(5706,1139.898,-2592.466,4.525,0.0,0.0,90.000);
- CreateObject(5706,1139.885,-2541.601,4.375,0.0,0.0,90.000);
- CreateObject(5706,1105.367,-2588.885,4.575,0.0,0.0,90.000);
- CreateObject(5706,1105.516,-2542.044,4.175,0.0,0.0,90.000);
- CreateObject(969,1213.362,-2561.887,2.250,0.0,0.0,-90.000);
- CreateObject(966,1181.317,-2564.452,2.083,0.0,0.0,90.000);
- CreateObject(968,1181.324,-2564.428,2.917,0.0,-90.000,90.000);
- CreateObject(969,1149.497,-2575.757,2.250,0.0,0.0,-270.000);
- CreateObject(969,1149.499,-2558.244,2.250,0.0,0.0,-90.000);
- CreateObject(966,1115.511,-2558.384,2.083,0.0,0.0,90.000);
- CreateObject(966,1115.512,-2572.663,2.083,0.0,0.0,-90.000);
- CreateObject(968,1115.532,-2558.347,2.852,0.0,-90.000,90.000);
- CreateObject(968,1115.524,-2572.794,2.842,0.0,-90.000,-90.000);
- CreateObject(969,1194.338,-2561.925,8.425,180.000,0.0,-90.000);
- CreateObject(969,1194.343,-2561.909,2.075,0.0,0.0,-90.000);
- CreateObject(7191,1194.244,-2565.362,10.432,180.000,0.0,0.0);
- CreateObject(7191,1194.298,-2572.476,-9.780,90.618,0.0,0.0);
- CreateObject(7191,1193.760,-2559.568,-9.730,90.618,0.0,0.0);
- CreateObject(968,1075.524,-2557.794,2.842,0.0,-90.000,-90.000);
- 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 OnPlayerCommandText(playerid, cmdtext[])
- {
- new cmd[256];
- new idx;
- cmd = strtok(cmdtext, idx);
- if(!strcmp(cmd, "/rotate", true))
- {
- new tmp4[256];
- tmp4 = strtok(cmdtext, idx);
- new tmp5[256];
- tmp5 = strtok(cmdtext, idx);
- new tmp6[256];
- tmp6 = strtok(cmdtext, idx);
- new tmp1[256];
- tmp1 = strtok(cmdtext, idx);
- new tmp2[256];
- tmp2 = strtok(cmdtext, idx);
- new tmp3[256];
- tmp3 = strtok(cmdtext, idx);
- if(!strlen(tmp1)||!strlen(tmp2)||!strlen(tmp3)||!strlen(tmp4)||!strlen(tmp5)||!strlen(tmp6))return SendClientMessage(playerid,0xffffffff,"Use: /rotate [obj] [rotX] [rotY] [rotZ] [Points] [Speed]");
- new Float:rot[3];
- GetObjectRot(strval(tmp4),rot[0],rot[1],rot[2]);
- RotateObject(strval(tmp4),rot[0]+floatstr(tmp5),rot[1]+floatstr(tmp6),rot[2]+floatstr(tmp1),strval(tmp2),floatstr(tmp3));
- return 1;
- }
- if(!strcmp(cmd, "/open", true))
- {
- new tmp1[256];
- tmp1 = strtok(cmdtext, idx);
- if(!strlen(tmp1))return SendClientMessage(playerid,0xffffffff,"Usa: /open [1-5]");
- new Float:rot[3];
- if(strval(tmp1)==1){GetObjectRot(10,rot[0],rot[1],rot[2]);RotateObject(10,rot[0],rot[1],rot[2]-90.0,90,50.0);open[10] = true;}
- if(strval(tmp1)==2){GetObjectRot(19,rot[0],rot[1],rot[2]);RotateObject(19,rot[0]-90.0,rot[1],rot[2],90,50.0);GetObjectRot(20,rot[0],rot[1],rot[2]);RotateObject(20,rot[0]+90.0,rot[1],rot[2],90,50.0);open[19] = true;open[20] = true;}
- if(strval(tmp1)==3){GetObjectRot(12,rot[0],rot[1],rot[2]);RotateObject(12,rot[0],rot[1]+90.0,rot[2],90,50.0);open[12] = true;}
- if(strval(tmp1)==4){GetObjectRot(13,rot[0],rot[1],rot[2]);RotateObject(13,rot[0],rot[1],rot[2]+90.0,90,50.0);GetObjectRot(14,rot[0],rot[1],rot[2]);RotateObject(14,rot[0],rot[1],rot[2]-90.0,90,50.0);open[13] = true;open[14] = true;}
- if(strval(tmp1)==5){GetObjectRot(17,rot[0],rot[1],rot[2]);RotateObject(17,rot[0],rot[1]+90.0,rot[2],90,50.0);GetObjectRot(18,rot[0],rot[1],rot[2]);RotateObject(18,rot[0],rot[1]+90.0,rot[2],90,50.0);open[17] = true;open[18] = true;}
- return 1;
- }
- if(!strcmp(cmd, "/bucle", true))
- {
- new tmp1[256];
- tmp1 = strtok(cmdtext, idx);
- new tmp2[256];
- tmp2 = strtok(cmdtext, idx);
- new tmp3[256];
- tmp3 = strtok(cmdtext, idx);
- new tmp4[256];
- tmp4 = strtok(cmdtext, idx);
- new tmp5[256];
- tmp5 = strtok(cmdtext, idx);
- if(!strlen(tmp1)||!strlen(tmp2)||!strlen(tmp3)||!strlen(tmp4)||!strlen(tmp5))return SendClientMessage(playerid,0xffffffff,"Use: /bucle [obj] [offX] [offY] [offZ] [speed]");
- GenerateBucle(strval(tmp1),floatstr(tmp2),floatstr(tmp3),floatstr(tmp4),floatstr(tmp5));
- return 1;
- }
- if(!strcmp(cmd, "/stopbucle", true))
- {
- new tmp1[256];
- tmp1 = strtok(cmdtext, idx);
- if(!strlen(tmp1))return SendClientMessage(playerid,0xffffffff,"Usa: /bucle [obj]");
- StopBucle(strval(tmp1));
- return 1;
- }
- return 0;
- }
- strtok(const string[], &index)
- {
- new length = strlen(string);
- while ((index < length) && (string[index] <= ' '))
- {
- index++;
- }
- new offset = index;
- new result[20];
- while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
- {
- result[index - offset] = string[index];
- index++;
- }
- result[index - offset] = EOS;
- return result;
- }
- public OnObjectRotated(objectid)
- {
- new Float:rot[3];
- GetObjectRot(objectid,rot[0],rot[1],rot[2]);
- if(objectid == 10 && open[10]){SetTimerEx("ReturnObject",1000,0,"dfffdf",10,rot[0],rot[1],rot[2]+90.0,90,50.0);}
- if(objectid == 19 && open[19]){SetTimerEx("ReturnObject",1000,0,"dfffdf",19,rot[0]+90.0,rot[1],rot[2],90,50.0);}
- if(objectid == 20 && open[20]){SetTimerEx("ReturnObject",1000,0,"dfffdf",20,rot[0]-90.0,rot[1],rot[2],90,50.0);}
- if(objectid == 12 && open[12]){SetTimerEx("ReturnObject",1000,0,"dfffdf",12,rot[0],rot[1]-90.0,rot[2],90,50.0);}
- if(objectid == 13 && open[13]){SetTimerEx("ReturnObject",1000,0,"dfffdf",13,rot[0],rot[1],rot[2]-90.0,90,50.0);}
- if(objectid == 14 && open[14]){SetTimerEx("ReturnObject",1000,0,"dfffdf",14,rot[0],rot[1],rot[2]+90.0,90,50.0);}
- if(objectid == 17 && open[17]){SetTimerEx("ReturnObject",1000,0,"dfffdf",17,rot[0],rot[1]-90.0,rot[2],90,50.0);}
- if(objectid == 18 && open[18]){SetTimerEx("ReturnObject",1000,0,"dfffdf",18,rot[0],rot[1]-90.0,rot[2],90,50.0);}
- return 1;
- }
- public OnObjectStopRotate(objectid)
- {
- return 1;
- }
- public OnObjectStopBucle(objectid)
- {
- return 1;
- }
- forward ReturnObject(objectid,Float:rotx,Float:roty,Float:rotz,points,Float:speed);
- public ReturnObject(objectid,Float:rotx,Float:roty,Float:rotz,points,Float:speed)
- {
- open[objectid] = false;
- RotateObject(objectid,rotx,roty,rotz,points,speed);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment