Advertisement
Guest User

Untitled

a guest
Oct 9th, 2018
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.02 KB | None | 0 0
  1. ocmd:createactor(playerid,params[])
  2. {
  3. new skin,string[128];
  4. if(PlayerInfo[playerid][pLoggedIn] == false) return 1;
  5. if(sscanf(params, "d", skin)) return SendClientMessage(playerid, -1, "USE: /createactor [SkinID]");
  6. if(!IsPlayerInRangeOfPoint(playerid, 10.0, ShopInfo[CurrentShop[playerid]][h_exitx], ShopInfo[CurrentShop[playerid]][h_exity], ShopInfo[CurrentShop[playerid]][h_exitz])) return SCM(playerid,COOLRED,"You are in no Shop");
  7. if(ShopInfo[CurrentShop[playerid]][actoryes] == 1) return SCM(playerid,COOLRED,"This Shop already has an Actor!");
  8. new Float:x,Float:y,Float:z,Float:a;
  9. GetPlayerPos(playerid,x,y,z);
  10.  
  11. GetPlayerFacingAngle(playerid,a);
  12. ShopInfo[CurrentShop[playerid]][actorx] = x;
  13. ShopInfo[CurrentShop[playerid]][actory] = y;
  14. ShopInfo[CurrentShop[playerid]][actorz] = z;
  15. ShopInfo[CurrentShop[playerid]][actora] = a;
  16. ShopInfo[CurrentShop[playerid]][actorskin] = skin;
  17. ShopInfo[CurrentShop[playerid]][actorid] = CreateDynamicActor(ShopInfo[CurrentShop[playerid]][actorskin], ShopInfo[CurrentShop[playerid]][actorx],ShopInfo[CurrentShop[playerid]][actory],ShopInfo[CurrentShop[playerid]][actorz],ShopInfo[CurrentShop[playerid]][actora], true, 100.0, ShopInfo[CurrentShop[playerid]][shopid], -1, -1, 7.0, -1, 0);
  18. new query[512];
  19. mysql_format(handle, query, sizeof(query), "UPDATE Houses SET actorx = '%f', actory = '%f',actorz = '%f', actora = '%f',actorskin = '%d', actoryes ='1' WHERE shopid = '%d'",
  20. ShopInfo[CurrentShop[playerid]][actorx],ShopInfo[CurrentShop[playerid]][actory],ShopInfo[CurrentShop[playerid]][actorz],ShopInfo[CurrentShop[playerid]][actora],ShopInfo[CurrentShop[playerid]][actorskin],ShopInfo[CurrentShop[playerid]][shopid]);
  21. mysql_pquery(handle, query, "ActorCreated", "di", playerid,ShopInfo[CurrentShop[playerid]][actorid]);
  22. format(string, sizeof(string), "You sucessfully created Actor %d, Skin ID %d",ShopInfo[CurrentShop[playerid]][actorid],ShopInfo[CurrentShop[playerid]][actorskin]);
  23. SCM(playerid,-1,string);
  24. printf(query);
  25. return 1;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement