Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * ## LEASE ATENTAMENTE PARA NO CONVERTIRSE EN LAMMER!!.: :D ##
- *
- * Estè Simple FILTERSCRIPT esta hecho especialmente para www.forum.sa-mp.com
- * NO Publicar estè FILTERSCRIPT en Otros foros de SA-MP y hacerse pasar por el creador del CODE.
- *
- * Codigo Creado Por OTACON
- *
- * CREDITOS:
- * OTACON: Realizacion y Idea de creacion del code.
- * TÙ: Modificacion libremente respetando lo mencionado ;).
- *
- * NOTA: Menos Creditos para los que me los critican.. JO'PUTAS! :D xD ;)
- *
- * Prohibido TOTALMENTE el Robo de Créditos o la
- * Publicación de este FILTERSCRIPT sin Mi Permiso.
- */
- /*
- * ## READ CAREFULLY TO AVOID BECOMING LAMMER!.: :D ##
- *
- * This simple FILTERSCRIPT is made especially for www.forum.sa-mp.com
- * DO NOT Post the FILTERSCRIPT in Other SAMP forums and impersonating the creator of the CODE.
- *
- * Code Created By OTACON
- *
- * CREDITS:
- * OTACON: Idea Making and code creation.
- * YOUR: Modification freely respecting the above ;).
- *
- * NOTE: Less Credits for those who criticize me.. JO'PUTAS! :D xD ;)
- *
- * FULLY spaces Theft Credit or
- * Publication of this FILTERSCRIPT without my permission.
- */
- /*
- http://i.imgur.com/2e5mYe6.png
- */
- #include <a_samp>
- #include <zcmd>
- enum twin{
- bool:dActive,
- bool:dInvulnerable,
- Float:dHealth,
- Float:dPos[4],
- dWorld,
- dTwin,
- dTimer,
- bool:dSale,
- dName[30],
- };
- new InfoTwin[MAX_PLAYERS][twin];
- COMMAND:twin(playerid,params[]){
- new Float:pos[5],
- VirtualWorld,
- pname[24],str[100];
- GetPlayerName(playerid,pname,sizeof(pname));
- if(InfoTwin[playerid][dSale]){
- if(!InfoTwin[playerid][dActive]){
- InfoTwin[playerid][dActive] = true;
- DestroyActor(InfoTwin[playerid][dTwin]);
- InfoTwin[playerid][dTwin] = CreateActor(GetPlayerSkin(playerid),0,0,0,0);
- SetActorPos(InfoTwin[playerid][dTwin], InfoTwin[playerid][dPos][0], InfoTwin[playerid][dPos][1], InfoTwin[playerid][dPos][2]);
- SetActorFacingAngle(InfoTwin[playerid][dTwin], InfoTwin[playerid][dPos][3]);
- SetActorHealth(InfoTwin[playerid][dTwin], InfoTwin[playerid][dHealth]);
- SetActorVirtualWorld(InfoTwin[playerid][dTwin], InfoTwin[playerid][dWorld]);
- SetActorInvulnerable(InfoTwin[playerid][dTwin], InfoTwin[playerid][dInvulnerable]);
- KillTimer(InfoTwin[playerid][dTimer]);
- ApplyActorAnimation(InfoTwin[playerid][dTwin], "CARRY","null",0,0,0,0,0,0);
- InfoTwin[playerid][dTimer] = SetTimerEx("update_twin",170,true,"i",playerid);
- // SendClientMessage(playerid,-1,"{FFFFFF}INFO: {00B100}sistema de gemelo encendido{FFFFFF}!.");
- PlayerPlaySound(playerid,21000,0,0,0);
- }else{
- InfoTwin[playerid][dActive] = false;
- GetActorPos(InfoTwin[playerid][dTwin], pos[0],pos[1],pos[2]);
- GetActorFacingAngle(InfoTwin[playerid][dTwin], pos[3]);
- GetActorHealth(InfoTwin[playerid][dTwin], pos[4]);
- VirtualWorld = GetActorVirtualWorld(InfoTwin[playerid][dTwin]);
- InfoTwin[playerid][dPos][0] = pos[0], InfoTwin[playerid][dPos][1] = pos[1], InfoTwin[playerid][dPos][2] = pos[2];
- InfoTwin[playerid][dPos][3] = pos[3];
- InfoTwin[playerid][dHealth] = pos[4];
- InfoTwin[playerid][dWorld] = VirtualWorld;
- InfoTwin[playerid][dInvulnerable] = InfoTwin[playerid][dInvulnerable];
- InfoTwin[playerid][dSale] = InfoTwin[playerid][dSale];
- DestroyActor(InfoTwin[playerid][dTwin]);
- KillTimer(InfoTwin[playerid][dTimer]);
- // SendClientMessage(playerid,-1,"{FFFFFF}INFO: {B00000}sistema de gemelo apagado{FFFFFF}!.");
- PlayerPlaySound(playerid,21000,0,0,0);
- }
- }else{
- GetPlayerPos(playerid, pos[0],pos[1],pos[2]);
- GetPlayerFacingAngle(playerid, pos[3]);
- GetPlayerHealth(playerid, pos[4]);
- VirtualWorld = GetPlayerVirtualWorld(playerid);
- pos[0] -= (2.0 * floatsin(-pos[4], degrees));
- pos[1] -= (2.0 * floatcos(-pos[4], degrees));
- InfoTwin[playerid][dPos][0] = pos[0], InfoTwin[playerid][dPos][1] = pos[1], InfoTwin[playerid][dPos][2] = pos[2];
- InfoTwin[playerid][dPos][3] = pos[3];
- InfoTwin[playerid][dHealth] = pos[4];
- InfoTwin[playerid][dWorld] = VirtualWorld;
- InfoTwin[playerid][dInvulnerable] = false;
- format(InfoTwin[playerid][dName],30,"%s Jr.", pname);
- InfoTwin[playerid][dSale] = true;
- /* SendClientMessage(playerid,-1,"{FFFFFF}INFO: {00B7FF}usted ha generado un gemelo, enhorabuena{FFFFFF}!.");
- format(str,sizeof(str),"{FFFFFF}INFO: {00B7FF}el nombre del gemelo es: {FFFFFF}%s", InfoTwin[playerid][dName]);
- SendClientMessage(playerid,-1,str); */
- PlayerPlaySound(playerid,21000,0,0,0);
- }
- return true;
- }
- forward update_twin(playerid);
- public update_twin(playerid){
- if(IsValidActor(InfoTwin[playerid][dTwin]) && InfoTwin[playerid][dSale]){
- static Float:pos[4],
- VirtualWorld,
- vehicleid,
- animlib[32],animname[32];
- GetAnimationName(GetPlayerAnimationIndex(playerid), animlib, sizeof(animlib), animname, sizeof(animname));
- vehicleid = GetPlayerVehicleID(playerid);
- if(!IsPlayerInAnyVehicle(playerid)) GetPlayerPos(playerid, pos[0], pos[1], pos[2]), GetPlayerFacingAngle(playerid, pos[3]), VirtualWorld = GetPlayerVirtualWorld(playerid);
- else GetVehiclePos(vehicleid, pos[0], pos[1], pos[2]), GetVehicleZAngle(vehicleid, pos[3]), VirtualWorld = GetVehicleVirtualWorld(vehicleid);
- if(!IsPlayerInAnyVehicle(playerid)) pos[0] -= (2 * floatsin(-pos[3], degrees)), pos[1] -= (2 * floatcos(-pos[3], degrees));
- else pos[0] -= (10 * floatsin(-pos[3], degrees)), pos[1] -= (10 * floatcos(-pos[3], degrees));
- SetActorPos(InfoTwin[playerid][dTwin], pos[0], pos[1], pos[2]);
- SetActorVirtualWorld(InfoTwin[playerid][dTwin], VirtualWorld);
- static Float:asd[2][3];
- GetPlayerCameraPos(playerid, asd[1][0],asd[1][1],asd[1][2]);
- GetPlayerCameraFrontVector(playerid, asd[0][0],asd[0][1],asd[0][2]);
- SetActorToFacePos(InfoTwin[playerid][dTwin], asd[0][0] + asd[1][0], asd[0][1]+asd[1][1]);
- ApplyActorAnimation(InfoTwin[playerid][dTwin], "CARRY","crry_prtial",0,0,0,0,0,0);
- if(IsPlayerInVehicle(playerid, GetPlayerVehicleID(playerid)){ ApplyActorAnimation(InfoTwin[playerid][dTwin], "PED","sprint_civi",4.1,0,1,1,1,1);
- }else ApplyActorAnimation(InfoTwin[playerid][dTwin], animlib,animname,4.1,0,1,1,1,1);
- }
- }
- forward Float:SetActorToFacePos(actorid, Float:X, Float:Y);
- public Float:SetActorToFacePos(actorid, Float:X, Float:Y){
- new Float:pX, Float:pY, Float:pZ, Float:ang;
- if(!IsValidActor(actorid)) return 0.0;
- GetActorPos(actorid, pX, pY, pZ);
- if( Y > pY ) ang = (-acos((X - pX) / floatsqroot((X - pX)*(X - pX) + (Y - pY)*(Y - pY))) - 90.0);
- else if( Y < pY && X < pX ) ang = (acos((X - pX) / floatsqroot((X - pX)*(X - pX) + (Y - pY)*(Y - pY))) - 450.0);
- else if( Y < pY ) ang = (acos((X - pX) / floatsqroot((X - pX)*(X - pX) + (Y - pY)*(Y - pY))) - 90.0);
- if(X > pX) ang = (floatabs(floatabs(ang) + 180.0));
- else ang = (floatabs(ang) - 180.0);
- ang += 180.0;
- SetActorFacingAngle(actorid, ang);
- SetActorFacingAngle(actorid, ang);
- return ang;
- }
- public OnFilterScriptInit(){
- AddPlayerClass(23,1916.1304,-1367.8215,13.6492,99.3507,0,0,0,0,0,0); //
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement