Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* CREDITS
- *
- ***************BulletRaja [Making Script]
- ***************Incognito [sscanf2]
- ***************Zeex [ZCMD]
- *
- */
- #define FILTERSCRIPT
- #include <a_samp>
- #include <sscanf2>
- #include <zcmd>
- new ohand[MAX_PLAYERS][MAX_PLAYERS];
- SetFacePlayer(playerid, giveplayerid)
- {
- new Float:playerangle;
- new Float:playermove = 5.0;
- new Float:posx, Float:posy, Float:posz;
- new Float:pix, Float:piy, Float:piz;
- GetPlayerPos(giveplayerid, posx, posy, posz);
- GetPlayerPos(playerid, pix, piy, piz);
- playerangle = 180.0-atan2(pix-posx,piy-posy);
- playerangle += playermove;
- playermove *= -1;
- SetPlayerFacingAngle(playerid, playerangle+playermove);
- }
- main()
- {
- print("\n----------------------------------");
- print(" HandShake System by BulletRaja");
- print("----------------------------------\n");
- }
- public OnFilterScriptInit()
- {
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- CMD:ohand(playerid, params[])
- {
- new tmp[256], id, Float:x, Float:y, Float:z, name[MAX_PLAYER_NAME];
- if(sscanf(params, "d", id)) return SendClientMessage(playerid, -1, "USAGE: /ohand <playerid>");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "Error: Invalid player id.");
- GetPlayerPos(id, x, y, z);
- GetPlayerName(playerid, name, sizeof(name));
- if(!IsPlayerInRangeOfPoint(playerid, 2.0, x, y, z)) return SendClientMessage(playerid, -1, "Error: You must be at that player to offer an hand shake.");
- ohand[playerid][id]=1;
- format(tmp, sizeof(tmp), "* %s has offer an hand shake.(/ahand)", name);
- SendClientMessage(id, -1, tmp);
- GetPlayerName(id, name, sizeof(name));
- format(tmp, sizeof(tmp), "* You have offered %s an hand shake", name);
- SendClientMessage(playerid, -1, tmp);
- return 1;
- }
- CMD:ahand(playerid, params[])
- {
- new tmp[256], id, Float:x, Float:y, Float:z, name[MAX_PLAYER_NAME];
- if(sscanf(params, "d", id)) return SendClientMessage(playerid, -1, "USAGE: /ahand <playerid>");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "Error: Invalid player id.");
- GetPlayerPos(id, x, y, z);
- GetPlayerName(playerid, name, sizeof(name));
- if(!IsPlayerInRangeOfPoint(playerid, 2.0, x, y, z)) return SendClientMessage(playerid, -1, "Error: You must be at that player to accept hand shake.");
- if(ohand[id][playerid]==0) return SendClientMessage(playerid, -1, "Error: That player did not offer you an hand shake.");
- ohand[id][playerid]=0;
- format(tmp, sizeof(tmp), "%s have accepted your hand shake", name);
- SendClientMessage(id, -1, tmp);
- GetPlayerName(id, name, sizeof(name));
- format(tmp, sizeof(tmp), "You have accepted %s's hand shake", name);
- SendClientMessage(playerid, -1, tmp);
- ClearAnimations(playerid);
- ClearAnimations(id);
- SetFacePlayer(playerid, id);
- SetFacePlayer(id, playerid);
- new tp = random(6);
- if(tp == 0) {
- ApplyAnimation(playerid, "GANGS","hndshkaa", 4.0,0,0,0,0,0);
- ApplyAnimation(id,"GANGS","hndshkaa",4.0,0,0,0,0,0);
- }
- else if(tp == 1) {
- ApplyAnimation(playerid,"GANGS","hndshkba",4.0,0,0,0,0,0);
- ApplyAnimation(id,"GANGS","hndshkba",4.0,0,0,0,0,0);
- }
- else if(tp == 2) {
- ApplyAnimation(playerid,"GANGS","hndshkda",4.0,0,0,0,0,0);
- ApplyAnimation(id,"GANGS","hndshkda",4.0,0,0,0,0,0);
- }
- else if(tp == 3) {
- ApplyAnimation(playerid,"GANGS","hndshkea",4.0,0,0,0,0,0);
- ApplyAnimation(id,"GANGS","hndshkea",4.0,0,0,0,0,0);
- }
- else if(tp == 4) {
- ApplyAnimation(playerid,"GANGS","hndshkfa",4.0,0,0,0,0,0);
- ApplyAnimation(id,"GANGS","hndshkfa",4.0,0,0,0,0,0);
- }
- else if(tp == 5) {
- ApplyAnimation(playerid,"GANGS","prtial_hndshk_biz_01",4.0,0,0,0,0,0);
- ApplyAnimation(id,"GANGS","prtial_hndshk_biz_01",4.0,0,0,0,0,0);
- }
- else {
- ApplyAnimation(playerid,"GANGS","hndshkea",4.0,0,0,0,0,0);
- ApplyAnimation(id,"GANGS","hndshkea",4.0,0,0,0,0,0);
- }
- return 1;
- }
- CMD:rhand(playerid, params[])
- {
- new tmp[256], id, Float:x, Float:y, Float:z, name[MAX_PLAYER_NAME];
- if(sscanf(params, "d", id)) return SendClientMessage(playerid, -1, "USAGE: /rhand <playerid>");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "Error: Invalid player id.");
- GetPlayerPos(id, x, y, z);
- GetPlayerName(playerid, name, sizeof(name));
- if(!IsPlayerInRangeOfPoint(playerid, 2.0, x, y, z)) return SendClientMessage(playerid, -1, "Error: You must be at that player to reject hand shake.");
- if(ohand[id][playerid]==0) return SendClientMessage(playerid, -1, "Error: That player did not offer you hand shake.");
- ohand[id][playerid]=0;
- format(tmp, sizeof(tmp), "%s has rejected your hand shake", name);
- SendClientMessage(id, -1, tmp);
- GetPlayerName(id, name, sizeof(name));
- format(tmp, sizeof(tmp), "You have rejected %s's hand shake", name);
- SendClientMessage(playerid, -1, tmp);
- return 1;
- }
Add Comment
Please, Sign In to add comment