Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- forward ActorCreated(playerid,actoridd); // bei Login
- public ActorCreated(playerid,actoridd)
- {
- printf("PlayerID %d erstellte actor ID %d",playerid,actorid);
- return 1;
- }
- forward OnShopsLoad();
- public OnShopsLoad()
- {
- new num_rows;
- cache_get_row_count(num_rows);
- if(!num_rows)return 1;
- for(new i; i<num_rows; i++)
- {
- new id=getFreeShopID();
- cache_get_value_name_int(i, "shopid", ShopInfo[id][shopid]);
- cache_get_value_name_float(i, "h_enterx", ShopInfo[id][h_enterx]);
- cache_get_value_name_float(i, "h_entery", ShopInfo[id][h_entery]);
- cache_get_value_name_float(i, "h_enterz", ShopInfo[id][h_enterz]);
- cache_get_value_name_float(i, "h_exitx", ShopInfo[id][h_exitx]);
- cache_get_value_name_float(i, "h_exity", ShopInfo[id][h_exity]);
- cache_get_value_name_float(i, "h_exitz", ShopInfo[id][h_exitz]);
- cache_get_value_name_int(i, "robtime", ShopInfo[id][robtime]);
- cache_get_value_name_int(i, "owned", ShopInfo[id][owned]);
- cache_get_value_name_int(i, "Fee", ShopInfo[id][Fee]);
- cache_get_value_name_int(i, "shopkasse", ShopInfo[id][shopkasse]);
- cache_get_value_name_int(i, "price", ShopInfo[id][price]);
- cache_get_value_name_int(i, "cameras", ShopInfo[id][cameras]);
- // cache_get_value_name_int(i, "shopname247", ShopInfo[id][owned]);
- cache_get_value_name(i, "shopname247", ShopInfo[id][shopname247], MAX_PLAYER_NAME);
- cache_get_value_name_int(i, "interior", ShopInfo[id][interior]);
- // cache_get_value_name_int(i, "owned", ShopInfo[id][owned]);
- cache_get_value_name(i, "owner", ShopInfo[id][owner], MAX_PLAYER_NAME);
- cache_get_value_name(i, "wmessage", ShopInfo[id][wmessage], MAX_PLAYER_NAME);
- cache_get_value_name_float(i, "actorx", ShopInfo[id][actorx]);
- cache_get_value_name_float(i, "actory", ShopInfo[id][actory]);
- cache_get_value_name_float(i, "actorz", ShopInfo[id][actorz]);
- cache_get_value_name_float(i, "actora", ShopInfo[id][actora]);
- cache_get_value_name_int(i, "actorskin", ShopInfo[id][actorskin]);
- cache_get_value_name_int(i, "actorid", ShopInfo[id][actorid]);
- cache_get_value_name_int(i, "actoryes", ShopInfo[id][actoryes]);
- updateShop(id);
- }
- return 1;
- }
- updateShop(id) //continue?
- {
- new string[128];
- if(ShopInfo[id][spickup] != -1)
- {
- DestroyPickup(ShopInfo[id][spickup]);
- }
- if(ShopInfo[id][stext] != Text3D:-1)
- {
- Delete3DTextLabel(ShopInfo[id][stext]);
- }
- if(ShopInfo[id][pdownarrow] != -1)
- {
- DestroyPickup(ShopInfo[id][pdownarrow]);
- }
- if(ShopInfo[id][mapicon] != -1)
- {
- DestroyDynamicMapIcon(ShopInfo[id][mapicon]);
- }
- if(!strlen(ShopInfo[id][owner]))
- {
- ShopInfo[id][mapicon] = CreateDynamicMapIcon(ShopInfo[id][h_enterx],ShopInfo[id][h_entery],ShopInfo[id][h_enterz],17,-1,-1,-1,-1,10.0,MAPICON_LOCAL);
- ShopInfo[id][spickup]=CreatePickup(1272, 1, ShopInfo[id][h_enterx], ShopInfo[id][h_entery], ShopInfo[id][h_enterz], -1); // davor -1
- format(string,sizeof(string), "{B18904}24/7 Shop\n{FFFFFF}For Sale\n{FFFFFF}Price: %i$\nShopID: %i\n[/buyshop] to Buy.", ShopInfo[id][price],ShopInfo[id][shopid]);
- ShopInfo[id][stext]=Create3DTextLabel(string, -1, ShopInfo[id][h_enterx], ShopInfo[id][h_entery], ShopInfo[id][h_enterz], 10, 0, 1);
- }
- else
- {
- ShopInfo[id][pdownarrow]=CreatePickup(1318, 1, ShopInfo[id][h_exitx], ShopInfo[id][h_exity], ShopInfo[id][h_exitz], ShopInfo[id][shopid]);
- ShopInfo[id][mapicon] = CreateDynamicMapIcon(ShopInfo[id][h_enterx],ShopInfo[id][h_entery],ShopInfo[id][h_enterz],17,-1,-1,-1,-1,100.0,MAPICON_LOCAL);
- ShopInfo[id][spickup]=CreatePickup(1273, 1, ShopInfo[id][h_enterx], ShopInfo[id][h_entery], ShopInfo[id][h_enterz], -1);
- // ShopInfo[id][spickup]=CreatePickup(1239, 1, ShopInfo[id][h_enterx], ShopInfo[id][h_entery], ShopInfo[id][h_enterz], -1);
- format(string,sizeof(string), "{B18904}24/7 Shop\n{FFFFFF}Shop-Name: %s\nOwner: %s\nShopID: %i\nPress[F] to Enter.", ShopInfo[id][shopname247],ShopInfo[id][owner],ShopInfo[id][shopid]);
- ShopInfo[id][stext]=Create3DTextLabel(string, -1, ShopInfo[id][h_enterx], ShopInfo[id][h_entery], ShopInfo[id][h_enterz], 10, 0, 1);
- if(ShopInfo[id][actoryes] == 0) return 1;
- ShopInfo[id][actorid] = CreateDynamicActor(ShopInfo[id][actorid], ShopInfo[id][actorx],ShopInfo[id][actory],ShopInfo[id][actorz],ShopInfo[id][actora], true, 100.0, ShopInfo[id][shopid], -1, -1, 7.0, -1, 0);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment