Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:shakehand(playerid, params[])
- {
- new string[128], giveplayerid, style;
- if(sscanf(params, "ud", giveplayerid, style)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /shakehand [playerid] [style (1-8)]");
- if(IsPlayerConnected(giveplayerid))
- {
- if(giveplayerid == playerid)
- {
- SendClientMessageEx(playerid, COLOR_GREY, "You can't shake your own hand.");
- return 1;
- }
- if(style >= 1 && style < 9)
- {
- new Float: ppFloats[3];
- GetPlayerPos(giveplayerid, ppFloats[0], ppFloats[1], ppFloats[2]);
- if(!IsPlayerInRangeOfPoint(playerid, 5, ppFloats[0], ppFloats[1], ppFloats[2]))
- {
- SendClientMessageEx(playerid, COLOR_GREY, "You're too far away. You can't shake hands right now.");
- return 1;
- }
- SetPVarInt(playerid, "shrequest", giveplayerid);
- SetPVarInt(playerid, "shstyle", style);
- format(string, sizeof(string), "You have requested to shake %s's hand, please wait for them to respond.", GetPlayerNameEx(giveplayerid));
- SendClientMessageEx(playerid, COLOR_WHITE, string);
- format(string, sizeof(string), "%s has requested to shake your hand, please use '/accept handshake' to approve the hand shake.", GetPlayerNameEx(playerid));
- SendClientMessageEx(giveplayerid, COLOR_WHITE, string);
- }
- else
- {
- SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /shakehand [playerid] [style (1-8)]");
- }
- }
- else
- {
- SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement