Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ocmd:createactor(playerid,params[])
- {
- new skin,string[128];
- if(PlayerInfo[playerid][pLoggedIn] == false) return 1;
- if(sscanf(params, "d", skin)) return SendClientMessage(playerid, -1, "USE: /createactor [SkinID]");
- 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");
- if(ShopInfo[CurrentShop[playerid]][actoryes] == 1) return SCM(playerid,COOLRED,"This Shop already has an Actor!");
- new Float:x,Float:y,Float:z,Float:a;
- GetPlayerPos(playerid,x,y,z);
- GetPlayerFacingAngle(playerid,a);
- ShopInfo[CurrentShop[playerid]][actorx] = x;
- ShopInfo[CurrentShop[playerid]][actory] = y;
- ShopInfo[CurrentShop[playerid]][actorz] = z;
- ShopInfo[CurrentShop[playerid]][actora] = a;
- ShopInfo[CurrentShop[playerid]][actorskin] = skin;
- 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);
- new query[512];
- mysql_format(handle, query, sizeof(query), "UPDATE Houses SET actorx = '%f', actory = '%f',actorz = '%f', actora = '%f',actorskin = '%d', actoryes ='1' WHERE shopid = '%d'",
- ShopInfo[CurrentShop[playerid]][actorx],ShopInfo[CurrentShop[playerid]][actory],ShopInfo[CurrentShop[playerid]][actorz],ShopInfo[CurrentShop[playerid]][actora],ShopInfo[CurrentShop[playerid]][actorskin],ShopInfo[CurrentShop[playerid]][shopid]);
- mysql_pquery(handle, query, "ActorCreated", "di", playerid,ShopInfo[CurrentShop[playerid]][actorid]);
- format(string, sizeof(string), "You sucessfully created Actor %d, Skin ID %d",ShopInfo[CurrentShop[playerid]][actorid],ShopInfo[CurrentShop[playerid]][actorskin]);
- SCM(playerid,-1,string);
- printf(query);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement